@rivus/agent 0.16.2 → 0.16.6

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.
@@ -1,4448 +0,0 @@
1
- import { Et as SessionKey, K as AgentTranscript, Mt as AgentInvocationOrigin, Y as AgentTranscriptTurn, a as AgentLoopInput, at as AgentRunState, et as AgentHistory, ht as AgentRunId$1, it as AgentRunPhase, l as TextAgentLoopCallback, n as AgentLoopCallback, nt as AgentSessionSummary, st as AgentDomainEvent, t as AgentLoop, tt as AgentRunSummary } from "./agent-loop.js";
2
- import { c as RivusHostToolDescriptor, g as RivusToolGrantSet, l as RivusMemoryAuthority, y as RivusToolRisk } from "./rivus-skill.js";
3
- import { M as RivusAgentDeployment, _ as AutomationPresentation, c as RivusPluginCatalog, d as RegisteredRivusAutomation, j as ResolvedRivusAgentDefinition, s as RivusPlugin } from "./rivus-plugin-testkit.js";
4
- import { C as SuspendBackgroundSessionInput, E as BackgroundSessionPhase, M as BackgroundSessionId, O as BackgroundSessionLease, S as CreateBackgroundSessionInput, b as BackgroundSession, d as BackgroundSessionLeasePrecondition, f as BackgroundSessionLeaseRequirement, j as BackgroundSessionMemoryScope, m as BackgroundSessionRepository$1, p as BackgroundSessionLeaseStaleOrAbsent, r as BackgroundSessionService, v as BackgroundSessionDeliveryRecord, w as BackgroundSessionSnapshot, x as ClaimBackgroundSessionInput, y as BackgroundSessionDeliveryStore } from "./background-session-service.js";
5
- import { c as ToolExecutionRequest$1, d as InvocationAuthorityRef$1, o as AuthorizationPolicyState$1, s as ToolApprovalRequest$1, t as PiToolApprovalGateway, u as InvocationAuthority$1 } from "./pi-tool-proxy.js";
6
- import { Effect, Stream } from "effect";
7
- import { Tracer } from "@opentelemetry/api";
8
-
9
- //#region src/core/application/run-presentation/projection/conversation-progress.d.ts
10
- declare const DEFAULT_CONVERSATION_PROGRESS_DISPLAY: "collapsed";
11
- type ConversationProgressDisplay = "hidden" | "collapsed" | "expanded";
12
- //#endregion
13
- //#region src/core/application/agent-execution/contracts/agent-execution-errors.d.ts
14
- declare class AgentHarnessBusy {
15
- readonly activeRun: ActiveAgentRun;
16
- readonly activeState?: AgentRunState | undefined;
17
- readonly _tag = "AgentHarnessBusy";
18
- readonly activeRunId: AgentRunId$1;
19
- readonly activeSessionKey: SessionKey;
20
- constructor(activeRun: ActiveAgentRun, activeState?: AgentRunState | undefined);
21
- }
22
- declare class AgentLoopFailed {
23
- readonly runId: AgentRunId$1;
24
- readonly errorMessage: string;
25
- readonly cause: unknown;
26
- readonly state?: AgentRunState | undefined;
27
- readonly _tag = "AgentLoopFailed";
28
- constructor(runId: AgentRunId$1, errorMessage: string, cause: unknown, state?: AgentRunState | undefined);
29
- }
30
- declare class AgentEventSinkFailed {
31
- readonly runId: AgentRunId$1;
32
- readonly eventType: AgentDomainEvent["type"];
33
- readonly cause: unknown;
34
- readonly _tag = "AgentEventSinkFailed";
35
- constructor(runId: AgentRunId$1, eventType: AgentDomainEvent["type"], cause: unknown);
36
- }
37
- declare class AgentEventHandlerFailed {
38
- readonly runId: AgentRunId$1;
39
- readonly eventType: AgentDomainEvent["type"];
40
- readonly cause: unknown;
41
- readonly state?: AgentRunState | undefined;
42
- readonly _tag = "AgentEventHandlerFailed";
43
- constructor(runId: AgentRunId$1, eventType: AgentDomainEvent["type"], cause: unknown, state?: AgentRunState | undefined);
44
- }
45
- declare class AgentRunCancelled {
46
- readonly runId: AgentRunId$1;
47
- readonly reason: string | undefined;
48
- readonly state: AgentRunState;
49
- readonly _tag = "AgentRunCancelled";
50
- constructor(runId: AgentRunId$1, reason: string | undefined, state: AgentRunState);
51
- }
52
- //#endregion
53
- //#region src/core/application/agent-execution/contracts/agent-execution-contracts.d.ts
54
- interface AgentClock {
55
- readonly now: Effect.Effect<Date>;
56
- }
57
- interface RunIdGenerator {
58
- readonly next: Effect.Effect<AgentRunId$1>;
59
- }
60
- interface PromptCommand {
61
- readonly invocation?: AgentInvocationOrigin;
62
- readonly sessionKey: SessionKey;
63
- readonly text: string;
64
- }
65
- interface AgentPromptResult {
66
- readonly runId: AgentRunId$1;
67
- readonly events: ReadonlyArray<AgentDomainEvent>;
68
- readonly finalText: string;
69
- readonly runSnapshot: AgentRunSnapshot;
70
- readonly snapshot: AgentSessionSnapshot;
71
- readonly state: AgentRunState;
72
- readonly turn: AgentTranscriptTurn;
73
- readonly updates: ReadonlyArray<AgentRunUpdate>;
74
- }
75
- interface AgentRunUpdate {
76
- readonly event: AgentDomainEvent;
77
- readonly previousState?: AgentRunState;
78
- readonly state: AgentRunState;
79
- }
80
- interface AgentRunSnapshot {
81
- readonly events: ReadonlyArray<AgentDomainEvent>;
82
- readonly runId: AgentRunId$1;
83
- readonly state?: AgentRunState;
84
- readonly summary: AgentRunSummary;
85
- readonly updates: ReadonlyArray<AgentRunUpdate>;
86
- }
87
- interface ActiveAgentRun {
88
- readonly runId: AgentRunId$1;
89
- readonly sessionKey: SessionKey;
90
- }
91
- type AgentHarnessAvailability = AgentHarnessIdleAvailability | AgentHarnessBusyAvailability;
92
- type AgentSessionAvailability = AgentHarnessIdleAvailability | AgentSessionBusyAvailability;
93
- interface AgentHarnessIdleAvailability {
94
- readonly busy: false;
95
- }
96
- interface AgentHarnessBusyAvailability {
97
- readonly activeRun: ActiveAgentRun;
98
- readonly activeRunId: AgentRunId$1;
99
- readonly activeSessionKey: SessionKey;
100
- readonly activeState?: AgentRunState;
101
- readonly busy: true;
102
- }
103
- type AgentSessionBusyAvailability = AgentSessionOwnedBusyAvailability | AgentSessionOtherBusyAvailability;
104
- interface AgentSessionOwnedBusyAvailability {
105
- readonly activeInSession: true;
106
- readonly activeRun: ActiveAgentRun;
107
- readonly activeRunId: AgentRunId$1;
108
- readonly activeState?: AgentRunState;
109
- readonly busy: true;
110
- }
111
- interface AgentSessionOtherBusyAvailability {
112
- readonly activeInSession: false;
113
- readonly busy: true;
114
- }
115
- interface AgentSessionSnapshot {
116
- readonly availability: AgentSessionAvailability;
117
- readonly latestRunSummary?: AgentRunSummary;
118
- readonly runs: ReadonlyArray<AgentRunSummary>;
119
- readonly sessionKey: SessionKey;
120
- readonly state?: AgentRunState;
121
- readonly summary?: AgentSessionSummary;
122
- readonly transcript: AgentTranscript;
123
- }
124
- type AgentHarnessError = AgentHarnessBusy | AgentLoopFailed | AgentEventSinkFailed | AgentEventHandlerFailed | AgentRunCancelled;
125
- interface AgentRunSubscriptionCapabilities {
126
- subscribe(listener: AgentDomainEventListener): () => void;
127
- subscribeRun(runId: AgentRunId$1, listener: AgentDomainEventListener): () => void;
128
- subscribeRunUpdates(runId: AgentRunId$1, listener: AgentRunUpdateListener): () => void;
129
- subscribeUpdates(listener: AgentRunUpdateListener): () => void;
130
- }
131
- interface AgentHarness extends AgentRunSubscriptionCapabilities {
132
- cancelActiveRun(reason?: string): Effect.Effect<boolean>;
133
- cancelRun(runId: AgentRunId$1, reason?: string): Effect.Effect<boolean>;
134
- steerRun(runId: AgentRunId$1, text: string): Effect.Effect<boolean>;
135
- forSession(sessionKey: SessionKey): AgentSessionHandle;
136
- getActiveRun(): ActiveAgentRun | undefined;
137
- getActiveRunId(): AgentRunId$1 | undefined;
138
- getActiveRunState(): AgentRunState | undefined;
139
- getAvailability(): AgentHarnessAvailability;
140
- getHistory(): AgentHistory;
141
- getRunEvents(runId: AgentRunId$1): ReadonlyArray<AgentDomainEvent> | undefined;
142
- getRunSnapshot(runId: AgentRunId$1): AgentRunSnapshot | undefined;
143
- getRunSummary(runId: AgentRunId$1): AgentRunSummary | undefined;
144
- getRunState(runId: AgentRunId$1): AgentRunState | undefined;
145
- getRunUpdates(runId: AgentRunId$1): ReadonlyArray<AgentRunUpdate> | undefined;
146
- getSessionHistory(sessionKey: SessionKey): AgentHistory;
147
- getSessionLatestRunSnapshot(sessionKey: SessionKey): AgentRunSnapshot | undefined;
148
- getSessionLatestRunSummary(sessionKey: SessionKey): AgentRunSummary | undefined;
149
- getSessionRuns(sessionKey: SessionKey): ReadonlyArray<AgentRunSummary>;
150
- getSessionSnapshot(sessionKey: SessionKey): AgentSessionSnapshot;
151
- getSessionSummary(sessionKey: SessionKey): AgentSessionSummary | undefined;
152
- getSessionTranscript(sessionKey: SessionKey): AgentTranscript;
153
- getSessionState(sessionKey: SessionKey): AgentRunState | undefined;
154
- getState(): AgentRunState;
155
- prompt(command: PromptCommand): Effect.Effect<AgentPromptResult, AgentHarnessError>;
156
- promptRunSnapshot(command: PromptCommand): Effect.Effect<AgentRunSnapshot, AgentHarnessError>;
157
- promptSnapshot(command: PromptCommand): Effect.Effect<AgentSessionSnapshot, AgentHarnessError>;
158
- promptText(command: PromptCommand): Effect.Effect<string, AgentHarnessError>;
159
- promptTurn(command: PromptCommand): Effect.Effect<AgentTranscriptTurn, AgentHarnessError>;
160
- promptWithEvents<R>(command: PromptCommand, onEvent: AgentDomainEventHandler<R>): Effect.Effect<AgentPromptResult, AgentHarnessError, R>;
161
- promptWithUpdates<R>(command: PromptCommand, onUpdate: AgentRunUpdateHandler<R>): Effect.Effect<AgentPromptResult, AgentHarnessError, R>;
162
- stream(command: PromptCommand): Stream.Stream<AgentDomainEvent, AgentHarnessError>;
163
- streamText(command: PromptCommand): Stream.Stream<string, AgentHarnessError>;
164
- streamUpdates(command: PromptCommand): Stream.Stream<AgentRunUpdate, AgentHarnessError>;
165
- }
166
- interface AgentSessionHandle extends AgentRunSubscriptionCapabilities {
167
- readonly sessionKey: SessionKey;
168
- cancelActiveRun(reason?: string): Effect.Effect<boolean>;
169
- cancelRun(runId: AgentRunId$1, reason?: string): Effect.Effect<boolean>;
170
- steerRun(runId: AgentRunId$1, text: string): Effect.Effect<boolean>;
171
- getActiveRun(): ActiveAgentRun | undefined;
172
- getActiveRunState(): AgentRunState | undefined;
173
- getAvailability(): AgentSessionAvailability;
174
- getHistory(): AgentHistory;
175
- getLatestRunSnapshot(): AgentRunSnapshot | undefined;
176
- getLatestRunSummary(): AgentRunSummary | undefined;
177
- getRunEvents(runId: AgentRunId$1): ReadonlyArray<AgentDomainEvent> | undefined;
178
- getRunSnapshot(runId: AgentRunId$1): AgentRunSnapshot | undefined;
179
- getRunSummary(runId: AgentRunId$1): AgentRunSummary | undefined;
180
- getRuns(): ReadonlyArray<AgentRunSummary>;
181
- getSnapshot(): AgentSessionSnapshot;
182
- getSummary(): AgentSessionSummary | undefined;
183
- getTranscript(): AgentTranscript;
184
- getRunState(runId: AgentRunId$1): AgentRunState | undefined;
185
- getRunUpdates(runId: AgentRunId$1): ReadonlyArray<AgentRunUpdate> | undefined;
186
- getState(): AgentRunState | undefined;
187
- prompt(text: string): Effect.Effect<AgentPromptResult, AgentHarnessError>;
188
- promptRunSnapshot(text: string): Effect.Effect<AgentRunSnapshot, AgentHarnessError>;
189
- promptSnapshot(text: string): Effect.Effect<AgentSessionSnapshot, AgentHarnessError>;
190
- promptText(text: string): Effect.Effect<string, AgentHarnessError>;
191
- promptTurn(text: string): Effect.Effect<AgentTranscriptTurn, AgentHarnessError>;
192
- promptWithEvents<R>(text: string, onEvent: AgentDomainEventHandler<R>): Effect.Effect<AgentPromptResult, AgentHarnessError, R>;
193
- promptWithUpdates<R>(text: string, onUpdate: AgentRunUpdateHandler<R>): Effect.Effect<AgentPromptResult, AgentHarnessError, R>;
194
- stream(text: string): Stream.Stream<AgentDomainEvent, AgentHarnessError>;
195
- streamText(text: string): Stream.Stream<string, AgentHarnessError>;
196
- streamUpdates(text: string): Stream.Stream<AgentRunUpdate, AgentHarnessError>;
197
- }
198
- type AgentDomainEventListener = (event: AgentDomainEvent) => void;
199
- type AgentRunUpdateListener = (update: AgentRunUpdate) => void;
200
- type AgentDomainEventHandler<R = never> = (event: AgentDomainEvent) => Effect.Effect<void, unknown, R>;
201
- type AgentRunUpdateHandler<R = never> = (update: AgentRunUpdate) => Effect.Effect<void, unknown, R>;
202
- interface AgentDomainEventSink {
203
- append(event: AgentDomainEvent): Effect.Effect<void, unknown>;
204
- }
205
- //#endregion
206
- //#region src/core/application/run-presentation/projection/presented-value.d.ts
207
- type PresentedValue = {
208
- readonly kind: "boolean";
209
- readonly value: boolean;
210
- } | {
211
- readonly entries: ReadonlyArray<{
212
- readonly key: string;
213
- readonly value: PresentedValue;
214
- }>;
215
- readonly kind: "record";
216
- readonly omittedEntries: number;
217
- } | {
218
- readonly items: ReadonlyArray<PresentedValue>;
219
- readonly kind: "list";
220
- readonly omittedItems: number;
221
- } | {
222
- readonly kind: "null";
223
- } | {
224
- readonly kind: "number";
225
- readonly value: number;
226
- } | {
227
- readonly kind: "redacted";
228
- readonly reason: "sensitive-key" | "sensitive-value";
229
- } | {
230
- readonly kind: "text";
231
- readonly omittedCharacters: number;
232
- readonly value: string;
233
- } | {
234
- readonly kind: "unsupported";
235
- readonly valueType: string;
236
- };
237
- interface PresentedValueOptions {
238
- readonly maxCollectionItems?: number;
239
- readonly maxDepth?: number;
240
- readonly maxNodes?: number;
241
- readonly maxStringCharacters?: number;
242
- }
243
- declare function createPresentedValue(value: unknown, options?: PresentedValueOptions): PresentedValue;
244
- //#endregion
245
- //#region src/core/application/run-presentation/projection/run-presentation.d.ts
246
- declare const RUN_PRESENTATION_SCHEMA_VERSION: 2;
247
- type AgentRunId = string;
248
- type RunPresentationPhase = "cancelled" | "completed" | "failed" | "running";
249
- type PresentationStepStatus = "completed" | "failed" | "running";
250
- interface PresentationStepBase {
251
- readonly durationMs?: number;
252
- readonly endedAt?: string;
253
- readonly id: string;
254
- readonly label: string;
255
- readonly startedAt: string;
256
- readonly status: PresentationStepStatus;
257
- }
258
- interface AssistantPresentationStep extends PresentationStepBase {
259
- readonly kind: "assistant";
260
- readonly text: string;
261
- }
262
- interface ModelPresentationStep extends PresentationStepBase {
263
- readonly kind: "model";
264
- readonly model: string;
265
- readonly provider: string;
266
- }
267
- interface SkillPresentationStep extends PresentationStepBase {
268
- readonly kind: "skill";
269
- readonly skillId: string;
270
- }
271
- interface ToolPresentationStep extends PresentationStepBase {
272
- readonly error?: PresentedValue;
273
- readonly input: PresentedValue;
274
- readonly kind: "tool";
275
- readonly output?: PresentedValue;
276
- readonly skillId?: string;
277
- readonly toolName: string;
278
- }
279
- interface ResponsePresentationStep extends PresentationStepBase {
280
- readonly kind: "response";
281
- }
282
- type PresentationStep = AssistantPresentationStep | ModelPresentationStep | ResponsePresentationStep | SkillPresentationStep | ToolPresentationStep;
283
- interface RunPresentation {
284
- readonly answer: {
285
- readonly format: "markdown";
286
- readonly text: string;
287
- };
288
- readonly omittedStepCount: number;
289
- readonly phase: RunPresentationPhase;
290
- readonly revision: number;
291
- readonly runId: AgentRunId;
292
- readonly schemaVersion: typeof RUN_PRESENTATION_SCHEMA_VERSION;
293
- readonly steps: ReadonlyArray<PresentationStep>;
294
- readonly totalStepCount: number;
295
- readonly totalToolCallCount: number;
296
- }
297
- declare function hasInspectableRunProgress(presentation: RunPresentation): boolean;
298
- //#endregion
299
- //#region src/adapters/feishu/card-presentation/streaming/feishu-stream-projector.d.ts
300
- type FeishuStreamAction = {
301
- readonly type: "update_text";
302
- readonly runId: AgentRunId$1;
303
- readonly text: string;
304
- } | {
305
- readonly presentation: RunPresentation;
306
- readonly runId: AgentRunId$1;
307
- readonly type: "update_progress";
308
- } | {
309
- readonly presentation?: RunPresentation;
310
- readonly runId: AgentRunId$1;
311
- readonly sessionKey: string;
312
- readonly text?: string;
313
- readonly type: "update_presentation";
314
- } | {
315
- readonly presentation?: RunPresentation;
316
- readonly type: "finish";
317
- readonly runId: AgentRunId$1;
318
- readonly text: string;
319
- } | {
320
- readonly presentation?: RunPresentation;
321
- readonly type: "fail";
322
- readonly runId: AgentRunId$1;
323
- readonly errorMessage: string;
324
- } | {
325
- readonly presentation?: RunPresentation;
326
- readonly type: "cancel";
327
- readonly runId: AgentRunId$1;
328
- readonly reason?: string;
329
- readonly text?: string;
330
- };
331
- interface FeishuStreamProjector {
332
- apply(event: AgentDomainEvent): ReadonlyArray<FeishuStreamAction>;
333
- applyUpdate(update: AgentRunUpdate): ReadonlyArray<FeishuStreamAction>;
334
- }
335
- declare function createFeishuStreamProjector(): FeishuStreamProjector;
336
- //#endregion
337
- //#region src/adapters/feishu/card-presentation/delivery/feishu-card-delivery-ledger.d.ts
338
- interface FeishuCardDeliveryRecord {
339
- readonly revision: number;
340
- readonly runId: AgentRunId$1;
341
- readonly sequence: number;
342
- readonly terminalPublished: boolean;
343
- }
344
- interface FeishuCardDeliveryLedger {
345
- isTerminalPublished(runId: AgentRunId$1): boolean;
346
- markTerminal(runId: AgentRunId$1): Effect.Effect<void, unknown>;
347
- reserveSequence(runId: AgentRunId$1): Effect.Effect<number, unknown>;
348
- }
349
- interface FeishuCardDeliveryLedgerStateOptions {
350
- readonly initial?: ReadonlyArray<FeishuCardDeliveryRecord>;
351
- readonly persist?: (record: FeishuCardDeliveryRecord) => Promise<void>;
352
- }
353
- interface FeishuCardDeliveryReconciler {
354
- reconcile(): Effect.Effect<{
355
- readonly repaired: number;
356
- readonly skipped: number;
357
- readonly terminalRuns: number;
358
- }, unknown>;
359
- }
360
- interface FeishuCardDeliveryReconcilerOptions {
361
- readonly events: ReadonlyArray<AgentDomainEvent>;
362
- readonly ledger: FeishuCardDeliveryLedger;
363
- readonly publish: (action: FeishuStreamAction) => Effect.Effect<void, unknown>;
364
- }
365
- declare function createFeishuCardDeliveryLedger(options?: FeishuCardDeliveryLedgerStateOptions): FeishuCardDeliveryLedger;
366
- declare function createFeishuCardDeliveryReconciler(options: FeishuCardDeliveryReconcilerOptions): FeishuCardDeliveryReconciler;
367
- //#endregion
368
- //#region src/adapters/compatibility/card-presentation/jsonl-feishu-card-delivery-ledger.d.ts
369
- interface JsonlFeishuCardDeliveryLedgerOptions {
370
- readonly filePath: string;
371
- }
372
- declare function openJsonlFeishuCardDeliveryLedger(options: JsonlFeishuCardDeliveryLedgerOptions): Promise<FeishuCardDeliveryLedger>;
373
- //#endregion
374
- //#region src/core/domain/human-interaction/aggregate/snapshot.d.ts
375
- type HumanInteractionId$1 = string;
376
- type HumanInteractionToolRisk = "observe" | "mutate" | "irreversible" | "host-control";
377
- interface HumanInteractionActor$1 {
378
- readonly openId: string;
379
- readonly tenantKey: string;
380
- }
381
- interface HumanInteractionFact$1 {
382
- readonly label: string;
383
- readonly value: string;
384
- }
385
- interface ToolApprovalBinding$1 {
386
- readonly agentId: string;
387
- readonly callId: string;
388
- readonly inputDigest: string;
389
- readonly instanceId: string;
390
- readonly operationId: string;
391
- readonly risk: HumanInteractionToolRisk;
392
- readonly runId: string;
393
- readonly sessionKey: string;
394
- readonly tenantKey: string;
395
- readonly toolId: string;
396
- readonly toolVersion: string;
397
- }
398
- interface HumanInteractionBase$1 {
399
- readonly agentId: string;
400
- readonly allowedActorOpenIds: ReadonlyArray<string>;
401
- readonly createdAt: string;
402
- readonly expiresAt: string;
403
- readonly facts: ReadonlyArray<HumanInteractionFact$1>;
404
- readonly id: HumanInteractionId$1;
405
- readonly instanceId: string;
406
- readonly revision: number;
407
- readonly runId: string;
408
- readonly sessionKey: string;
409
- readonly sourceMessageId: string;
410
- readonly summary: string;
411
- readonly tenantKey: string;
412
- readonly title: string;
413
- }
414
- interface PendingHumanInteractionState$1 {
415
- readonly status: "pending";
416
- }
417
- interface ApprovedHumanInteractionState$1 {
418
- readonly actor: HumanInteractionActor$1;
419
- readonly consumedAt?: string;
420
- readonly resolvedAt: string;
421
- readonly status: "approved";
422
- }
423
- interface RejectedHumanInteractionState$1 {
424
- readonly actor: HumanInteractionActor$1;
425
- readonly resolvedAt: string;
426
- readonly status: "rejected";
427
- }
428
- interface SelectedHumanInteractionState$1 {
429
- readonly actor: HumanInteractionActor$1;
430
- readonly optionId: string;
431
- readonly resolvedAt: string;
432
- readonly status: "selected";
433
- }
434
- interface ExpiredHumanInteractionState$1 {
435
- readonly expiredAt: string;
436
- readonly status: "expired";
437
- }
438
- interface CancelledHumanInteractionState$1 {
439
- readonly cancelledAt: string;
440
- readonly reason?: string;
441
- readonly status: "cancelled";
442
- }
443
- type ToolApprovalInteractionState$1 = PendingHumanInteractionState$1 | ApprovedHumanInteractionState$1 | RejectedHumanInteractionState$1 | ExpiredHumanInteractionState$1 | CancelledHumanInteractionState$1;
444
- interface ToolApprovalInteraction$1 extends HumanInteractionBase$1 {
445
- readonly kind: "tool-approval";
446
- readonly request: Omit<ToolApprovalBinding$1, "agentId" | "instanceId" | "runId" | "sessionKey" | "tenantKey">;
447
- readonly state: ToolApprovalInteractionState$1;
448
- }
449
- interface UserDecisionOption$1 {
450
- readonly description: string;
451
- readonly id: string;
452
- readonly label: string;
453
- }
454
- type UserDecisionInteractionState$1 = PendingHumanInteractionState$1 | SelectedHumanInteractionState$1 | RejectedHumanInteractionState$1 | ExpiredHumanInteractionState$1 | CancelledHumanInteractionState$1;
455
- interface UserDecisionInteraction$1 extends HumanInteractionBase$1 {
456
- readonly kind: "user-decision";
457
- readonly options: ReadonlyArray<UserDecisionOption$1>;
458
- readonly recommendedOptionId?: string;
459
- readonly state: UserDecisionInteractionState$1;
460
- }
461
- type HumanInteraction$1 = ToolApprovalInteraction$1 | UserDecisionInteraction$1;
462
- type HumanInteractionSnapshot = HumanInteraction$1;
463
- type HumanInteractionResolutionAction$1 = "approve" | "reject" | "select";
464
- type HumanInteractionTransition$1 = {
465
- readonly action: HumanInteractionResolutionAction$1;
466
- readonly actor: HumanInteractionActor$1;
467
- readonly now: string;
468
- readonly optionId?: string;
469
- readonly type: "resolve";
470
- } | {
471
- readonly binding: ToolApprovalBinding$1;
472
- readonly now: string;
473
- readonly type: "consume-approval";
474
- } | {
475
- readonly now: string;
476
- readonly reason?: string;
477
- readonly type: "cancel";
478
- };
479
- interface RequestToolApprovalInput$1 {
480
- readonly agentId: string;
481
- readonly allowedActorOpenIds: ReadonlyArray<string>;
482
- readonly expiresAt: string;
483
- readonly facts: ReadonlyArray<HumanInteractionFact$1>;
484
- readonly instanceId: string;
485
- readonly interactionId: string;
486
- readonly request: {
487
- readonly callId: string;
488
- readonly inputDigest: string;
489
- readonly operationId: string;
490
- readonly risk: HumanInteractionToolRisk;
491
- readonly toolId: string;
492
- readonly toolVersion: string;
493
- };
494
- readonly runId: string;
495
- readonly sessionKey: string;
496
- readonly sourceMessageId: string;
497
- readonly summary: string;
498
- readonly tenantKey: string;
499
- readonly title: string;
500
- }
501
- interface RequestUserDecisionInput$1 {
502
- readonly agentId: string;
503
- readonly allowedActorOpenIds: ReadonlyArray<string>;
504
- readonly expiresAt: string;
505
- readonly facts: ReadonlyArray<HumanInteractionFact$1>;
506
- readonly instanceId: string;
507
- readonly interactionId: string;
508
- readonly options: ReadonlyArray<UserDecisionOption$1>;
509
- readonly recommendedOptionId?: string;
510
- readonly runId: string;
511
- readonly sessionKey: string;
512
- readonly sourceMessageId: string;
513
- readonly summary: string;
514
- readonly tenantKey: string;
515
- readonly title: string;
516
- }
517
- //#endregion
518
- //#region src/core/application/human-interaction/ports/human-interaction-contracts.d.ts
519
- interface HumanInteractionClock$1 {
520
- now(): string;
521
- }
522
- interface ResolveHumanInteractionInput$1 {
523
- readonly action: HumanInteractionResolutionAction$1;
524
- readonly actor: HumanInteractionActor$1;
525
- readonly interactionId: string;
526
- readonly optionId?: string;
527
- }
528
- interface ConsumeToolApprovalInput$1 {
529
- readonly approvalId: string;
530
- readonly binding: ToolApprovalBinding$1;
531
- }
532
- interface HumanInteractionServiceContract<Interaction, ToolApprovalInteraction = Interaction, UserDecisionInteraction = Interaction, ToolApprovalInput = RequestToolApprovalInput$1, UserDecisionInput = RequestUserDecisionInput$1, ResolveInput = ResolveHumanInteractionInput$1, ConsumeInput = ConsumeToolApprovalInput$1> {
533
- consumeToolApproval(input: ConsumeInput): Effect.Effect<boolean, unknown>;
534
- get(interactionId: string): Effect.Effect<Interaction | undefined, unknown>;
535
- resolve(input: ResolveInput): Effect.Effect<Interaction, unknown>;
536
- requestToolApproval(input: ToolApprovalInput): Effect.Effect<ToolApprovalInteraction, unknown>;
537
- requestUserDecision(input: UserDecisionInput): Effect.Effect<UserDecisionInteraction, unknown>;
538
- waitForResolution(input: {
539
- readonly interactionId: string;
540
- readonly signal?: AbortSignal;
541
- }): Effect.Effect<Interaction, unknown>;
542
- }
543
- interface HumanInteractionServiceOptionsContract<Clock, Presenter, Repository> {
544
- readonly clock: Clock;
545
- readonly presenter: Presenter;
546
- readonly repository: Repository;
547
- readonly sleep?: (ms: number) => Promise<void>;
548
- }
549
- //#endregion
550
- //#region src/core/application/human-interaction/ports/human-interaction-presenter.d.ts
551
- interface HumanInteractionPresenterContract<Interaction> {
552
- present(interaction: Interaction): Effect.Effect<void, unknown>;
553
- }
554
- //#endregion
555
- //#region src/core/application/human-interaction/ports/human-interaction-repository.d.ts
556
- declare class HumanInteractionRepositoryError extends Error {
557
- readonly operation: "create" | "get" | "update";
558
- readonly cause?: unknown | undefined;
559
- readonly name = "HumanInteractionRepositoryError";
560
- constructor(operation: "create" | "get" | "update", message: string, cause?: unknown | undefined);
561
- }
562
- interface HumanInteractionRepositoryContract<Interaction> {
563
- create(interaction: Interaction): Effect.Effect<void, HumanInteractionRepositoryError>;
564
- get(id: HumanInteractionId$1): Effect.Effect<Interaction | undefined, HumanInteractionRepositoryError>;
565
- update(id: HumanInteractionId$1, transition: (current: Interaction) => Interaction): Effect.Effect<Interaction, HumanInteractionRepositoryError>;
566
- }
567
- //#endregion
568
- //#region src/adapters/feishu/protocol/feishu-receive-message.d.ts
569
- interface FeishuReceiveMessagePayload {
570
- readonly header?: {
571
- readonly tenant_key?: string;
572
- };
573
- readonly event: {
574
- readonly sender?: {
575
- readonly sender_id?: {
576
- readonly open_id?: string;
577
- };
578
- readonly sender_type?: string;
579
- readonly tenant_key?: string;
580
- };
581
- readonly message: {
582
- readonly create_time?: string;
583
- readonly message_id: string;
584
- readonly chat_id: string;
585
- readonly chat_type?: string;
586
- readonly thread_id?: string;
587
- readonly parent_id?: string;
588
- readonly root_id?: string;
589
- readonly message_type: string;
590
- readonly mentions?: ReadonlyArray<{
591
- readonly id?: Readonly<Record<string, string>>;
592
- readonly key?: string;
593
- readonly name?: string;
594
- }>;
595
- readonly content: string;
596
- };
597
- };
598
- }
599
- //#endregion
600
- //#region src/adapters/feishu/conversation-session/feishu-session-key.d.ts
601
- type ConversationSessionKey = string;
602
- interface FeishuSessionReference {
603
- readonly tenantKey: string;
604
- readonly chatId: string;
605
- readonly threadId?: string;
606
- readonly agentId: string;
607
- }
608
- type FeishuConversationReference = Omit<FeishuSessionReference, "agentId">;
609
- declare class InvalidFeishuSessionReference {
610
- readonly field: keyof FeishuSessionReference;
611
- readonly message: string;
612
- readonly _tag = "InvalidFeishuSessionReference";
613
- constructor(field: keyof FeishuSessionReference, message: string);
614
- }
615
- declare function createFeishuSessionKey(reference: FeishuSessionReference): Effect.Effect<ConversationSessionKey, InvalidFeishuSessionReference>;
616
- declare function createFeishuConversationId(reference: FeishuConversationReference): Effect.Effect<string, InvalidFeishuSessionReference>;
617
- //#endregion
618
- //#region src/adapters/feishu/conversation-session/feishu-session-store.d.ts
619
- interface FeishuSessionEpochRecord {
620
- readonly baseSessionKey: string;
621
- readonly generation: number;
622
- }
623
- interface FeishuSessionResetResult {
624
- readonly generation: number;
625
- readonly previousSessionKey: string;
626
- readonly sessionKey: string;
627
- }
628
- interface FeishuSessionStore {
629
- current(baseSessionKey: string): Effect.Effect<string, Error>;
630
- reset(baseSessionKey: string): Effect.Effect<FeishuSessionResetResult, Error>;
631
- }
632
- interface FeishuSessionStoreOptions {
633
- readonly initial?: ReadonlyArray<FeishuSessionEpochRecord>;
634
- readonly persist?: (records: ReadonlyArray<FeishuSessionEpochRecord>) => Promise<void>;
635
- }
636
- declare function createFeishuSessionStore(options?: FeishuSessionStoreOptions): FeishuSessionStore;
637
- //#endregion
638
- //#region src/adapters/feishu/protocol/feishu-message-content.d.ts
639
- declare class UnsupportedFeishuMessage extends Error {
640
- readonly messageType: string;
641
- readonly name = "UnsupportedFeishuMessage";
642
- readonly _tag = "UnsupportedFeishuMessage";
643
- constructor(messageType: string);
644
- }
645
- declare class InvalidFeishuMessageContent extends Error {
646
- readonly reason: string;
647
- readonly name = "InvalidFeishuMessageContent";
648
- readonly _tag = "InvalidFeishuMessageContent";
649
- constructor(reason: string, options?: ErrorOptions);
650
- }
651
- interface FeishuMessageContentInput {
652
- readonly content: string;
653
- readonly messageType: string;
654
- }
655
- declare function readFeishuMessageContent(input: FeishuMessageContentInput): Effect.Effect<string, UnsupportedFeishuMessage | InvalidFeishuMessageContent>;
656
- //#endregion
657
- //#region src/adapters/feishu/intake/feishu-message-intake.d.ts
658
- interface FeishuMessageIntakeOptions {
659
- readonly agentId: string;
660
- readonly botOpenId?: string;
661
- readonly sessionStore?: FeishuSessionStore;
662
- }
663
- interface FeishuPromptAgentCommand {
664
- readonly conversationId: string;
665
- readonly messageId: string;
666
- readonly command: PromptCommand;
667
- readonly type: "prompt";
668
- }
669
- interface FeishuNewSessionCommand {
670
- readonly messageId: string;
671
- readonly previousSessionKey: SessionKey;
672
- readonly sessionKey: SessionKey;
673
- readonly type: "new_session";
674
- }
675
- interface FeishuCancelRunCommand {
676
- readonly type: "cancel_run";
677
- readonly messageId: string;
678
- /** Omitted when `/cancel` targets the active run in this Feishu session. */
679
- readonly runId?: AgentRunId$1;
680
- readonly reason: string;
681
- readonly sessionKey?: SessionKey;
682
- readonly token?: string;
683
- }
684
- type FeishuAgentCommand = FeishuPromptAgentCommand | FeishuNewSessionCommand | FeishuCancelRunCommand;
685
- type FeishuMessageIntakeSummary = FeishuPromptMessageIntakeSummary | FeishuNewSessionMessageIntakeSummary | FeishuCancelMessageIntakeSummary;
686
- interface FeishuMessageIntakeBaseSummary {
687
- readonly messageId: string;
688
- readonly sessionKey: SessionKey;
689
- readonly sessionReference: FeishuSessionReference;
690
- }
691
- interface FeishuPromptMessageIntakeSummary extends FeishuMessageIntakeBaseSummary {
692
- readonly commandType: "prompt";
693
- readonly text: string;
694
- }
695
- interface FeishuNewSessionMessageIntakeSummary extends FeishuMessageIntakeBaseSummary {
696
- readonly commandType: "new_session";
697
- readonly previousSessionKey: SessionKey;
698
- }
699
- interface FeishuCancelMessageIntakeSummary extends FeishuMessageIntakeBaseSummary {
700
- readonly commandType: "cancel_run";
701
- readonly reason: string;
702
- readonly runId?: AgentRunId$1;
703
- }
704
- type FeishuMessageIntakeError = UnsupportedFeishuMessage | InvalidFeishuMessageContent | InvalidFeishuSessionReference;
705
- declare function createAgentCommandFromFeishuMessage(payload: FeishuReceiveMessagePayload, options: FeishuMessageIntakeOptions): Effect.Effect<FeishuAgentCommand, FeishuMessageIntakeError>;
706
- declare function describeFeishuMessageIntake(payload: FeishuReceiveMessagePayload, options: FeishuMessageIntakeOptions): Effect.Effect<FeishuMessageIntakeSummary, FeishuMessageIntakeError>;
707
- //#endregion
708
- //#region src/adapters/feishu/intake/feishu-card-action-intake.d.ts
709
- interface FeishuCardActionTriggerPayload {
710
- readonly action?: {
711
- readonly tag?: string;
712
- readonly value?: unknown;
713
- };
714
- readonly context?: {
715
- readonly chat_id?: string;
716
- readonly open_chat_id?: string;
717
- readonly open_message_id?: string;
718
- };
719
- readonly event?: FeishuCardActionTriggerPayload;
720
- readonly event_type?: string;
721
- readonly operator?: {
722
- readonly open_id?: string;
723
- readonly tenant_key?: string;
724
- readonly union_id?: string;
725
- readonly user_id?: string;
726
- };
727
- readonly token?: string;
728
- }
729
- declare class InvalidFeishuCardAction {
730
- readonly reason: string;
731
- readonly _tag = "InvalidFeishuCardAction";
732
- constructor(reason: string);
733
- }
734
- declare class UnsupportedFeishuCardAction {
735
- readonly reason: string;
736
- readonly _tag = "UnsupportedFeishuCardAction";
737
- constructor(reason: string);
738
- }
739
- type FeishuCardActionIntakeError = InvalidFeishuCardAction | UnsupportedFeishuCardAction;
740
- interface FeishuResolveInteractionCommand {
741
- readonly action: HumanInteractionResolutionAction$1;
742
- readonly actor: HumanInteractionActor$1;
743
- readonly interactionId: string;
744
- readonly messageId: string;
745
- readonly optionId?: string;
746
- readonly token: string;
747
- readonly type: "resolve_interaction";
748
- }
749
- type FeishuCardActionCommand = FeishuCancelRunCommand | FeishuResolveInteractionCommand;
750
- declare function createAgentCommandFromFeishuCardAction(payload: FeishuCardActionTriggerPayload): Effect.Effect<FeishuCardActionCommand, FeishuCardActionIntakeError>;
751
- //#endregion
752
- //#region src/adapters/feishu/protocol/feishu-agent-run-preparation.d.ts
753
- interface FeishuAgentRunPreparation {
754
- readonly messageId: string;
755
- readonly prompt: string;
756
- readonly receiveId: string;
757
- readonly runId: AgentRunId$1;
758
- readonly sessionKey: SessionKey;
759
- }
760
- //#endregion
761
- //#region src/adapters/feishu/intake/feishu-prompt-context.d.ts
762
- interface FeishuPromptContextInput {
763
- readonly payload: FeishuReceiveMessagePayload;
764
- readonly text: string;
765
- }
766
- /** Resolves conversation context only when a message is about to start a run. */
767
- interface FeishuPromptContextResolver {
768
- resolve(input: FeishuPromptContextInput): Effect.Effect<string, unknown>;
769
- }
770
- declare function composeFeishuTopicPrompt(currentText: string, rootText: string): string;
771
- //#endregion
772
- //#region src/adapters/feishu/intake/feishu-agent-daemon.d.ts
773
- interface FeishuAgentDaemonBaseOptions {
774
- readonly acknowledgeSteering?: (messageId: string) => Effect.Effect<void, unknown>;
775
- readonly agentId: string;
776
- readonly botOpenId?: string;
777
- readonly dedupe?: boolean;
778
- readonly finalizeRun?: (runId: AgentRunId$1) => Effect.Effect<void>;
779
- readonly interactions?: FeishuHumanInteractionActions;
780
- readonly prepareRun?: (run: FeishuAgentRunPreparation) => Effect.Effect<void, unknown>;
781
- readonly publish: (action: FeishuStreamAction) => Effect.Effect<void, unknown>;
782
- readonly publishRunUpdate?: AgentRunUpdateHandler;
783
- readonly reply?: (messageId: string, text: string) => Effect.Effect<void, unknown>;
784
- readonly promptContext?: FeishuPromptContextResolver;
785
- readonly resolveInvocation?: (payload: FeishuReceiveMessagePayload, conversationId: string) => AgentInvocationOrigin;
786
- readonly sessionStore?: FeishuSessionStore;
787
- }
788
- type FeishuAgentDaemonOptions = FeishuAgentDaemonBaseOptions & ({
789
- readonly execution: FeishuAgentExecution;
790
- readonly harness?: never;
791
- } | {
792
- readonly execution?: never;
793
- readonly harness: AgentHarness;
794
- });
795
- interface FeishuAgentExecutionResult {
796
- readonly finalText: string;
797
- readonly runId: AgentRunId$1;
798
- }
799
- interface FeishuAgentExecution {
800
- cancelActiveRun(input: {
801
- readonly reason: string;
802
- readonly sessionKey: SessionKey;
803
- }): Effect.Effect<AgentRunId$1 | undefined, unknown>;
804
- cancelRun(input: {
805
- readonly reason: string;
806
- readonly runId: AgentRunId$1;
807
- readonly sessionKey?: SessionKey;
808
- }): Effect.Effect<boolean, unknown>;
809
- getActiveRun?(input: {
810
- readonly sessionKey: SessionKey;
811
- }): Effect.Effect<AgentRunId$1 | undefined, unknown>;
812
- /** Routes a message into the active run without creating a second run/card. */
813
- steerRun(input: {
814
- readonly sessionKey: SessionKey;
815
- readonly text: string;
816
- }): Effect.Effect<{
817
- readonly runId: AgentRunId$1;
818
- readonly steered: true;
819
- } | undefined, unknown>;
820
- promptWithUpdates(command: PromptCommand, onUpdate: AgentRunUpdateHandler): Effect.Effect<FeishuAgentExecutionResult, unknown>;
821
- }
822
- interface FeishuAgentDaemonRunResult {
823
- readonly messageId: string;
824
- readonly runId: string;
825
- readonly finalText: string;
826
- }
827
- interface FeishuAgentDaemonSkippedResult {
828
- readonly messageId: string;
829
- readonly skipped: true;
830
- readonly reason: "duplicate";
831
- }
832
- interface FeishuAgentDaemonCancelResult {
833
- readonly cancelled: boolean;
834
- readonly messageId: string;
835
- readonly runId?: AgentRunId$1;
836
- readonly reason?: "not_active";
837
- }
838
- interface FeishuAgentDaemonSteeredResult {
839
- readonly messageId: string;
840
- readonly runId: AgentRunId$1;
841
- readonly steered: true;
842
- }
843
- interface FeishuAgentDaemonInteractionResult {
844
- readonly interaction: HumanInteractionSnapshot;
845
- readonly interactionId: string;
846
- readonly messageId: string;
847
- readonly resolved: true;
848
- }
849
- interface FeishuAgentDaemonSessionResetResult {
850
- readonly messageId: string;
851
- readonly previousSessionKey: SessionKey;
852
- readonly sessionKey: SessionKey;
853
- readonly reset: true;
854
- }
855
- interface FeishuHumanInteractionActions {
856
- resolve(input: ResolveHumanInteractionInput$1): Effect.Effect<HumanInteractionSnapshot, unknown>;
857
- }
858
- type FeishuAgentDaemonHandleResult = FeishuAgentDaemonRunResult | FeishuAgentDaemonSkippedResult | FeishuAgentDaemonCancelResult | FeishuAgentDaemonSteeredResult | FeishuAgentDaemonInteractionResult | FeishuAgentDaemonSessionResetResult;
859
- interface FeishuAgentPreparedControl {
860
- execute(): Effect.Effect<FeishuAgentDaemonHandleResult | undefined, unknown>;
861
- }
862
- type FeishuAgentMessageSideEffects = "enabled" | "disabled";
863
- interface FeishuAgentDaemonHandleMessageOptions {
864
- readonly sideEffects?: FeishuAgentMessageSideEffects;
865
- }
866
- interface FeishuAgentDaemon {
867
- handleCardAction(payload: FeishuCardActionTriggerPayload): Effect.Effect<FeishuAgentDaemonHandleResult, unknown>;
868
- prepareControlMessage(payload: FeishuReceiveMessagePayload): Effect.Effect<FeishuAgentPreparedControl | undefined, unknown>;
869
- trySteerMessage(payload: FeishuReceiveMessagePayload): Effect.Effect<FeishuAgentDaemonHandleResult | undefined, unknown>;
870
- handleMessage(payload: FeishuReceiveMessagePayload, options?: FeishuAgentDaemonHandleMessageOptions): Effect.Effect<FeishuAgentDaemonHandleResult, unknown>;
871
- }
872
- declare function createFeishuAgentDaemon(options: FeishuAgentDaemonOptions): FeishuAgentDaemon;
873
- //#endregion
874
- //#region src/core/application/recovery/contracts/recovery-control.d.ts
875
- interface RecoveryAction {
876
- readonly actorId: string;
877
- readonly at: string;
878
- readonly note: string;
879
- }
880
- type RecoveryToolOperationOutcome = {
881
- readonly result: unknown;
882
- readonly status: "applied";
883
- } | {
884
- readonly status: "not-applied";
885
- };
886
- interface DeadLetterRecoveryItem {
887
- readonly acceptedAt: string;
888
- readonly attempts: number;
889
- readonly deliveryId: string;
890
- readonly endpointId: string;
891
- readonly failureCode: "delivery_failed";
892
- readonly failureSummary: string;
893
- readonly failedAt: string;
894
- readonly revision: number;
895
- }
896
- interface DeadLetterRequeueResult {
897
- readonly acceptedAt: string;
898
- readonly attempts: 0;
899
- readonly availableAt: string;
900
- readonly deliveryId: string;
901
- readonly endpointId: string;
902
- readonly recoveredAt: string;
903
- readonly recoveredBy: string;
904
- readonly revision: number;
905
- readonly status: "pending";
906
- }
907
- interface RecoverySnapshot {
908
- readonly deadLetters: ReadonlyArray<DeadLetterRecoveryItem>;
909
- readonly toolOperations: ReadonlyArray<ToolOperationRecoveryItem>;
910
- }
911
- interface ToolOperationRecoveryItem {
912
- readonly agentId: string;
913
- readonly inputDigest: string;
914
- readonly instanceId: string;
915
- readonly operationId: string;
916
- readonly failureCode: "tool_outcome_unknown";
917
- readonly failureSummary: string;
918
- readonly revision: number;
919
- readonly status: "reconciliation-required";
920
- readonly toolId: string;
921
- readonly toolVersion: string;
922
- }
923
- interface ToolOperationResolutionResult {
924
- readonly agentId: string;
925
- readonly inputDigest: string;
926
- readonly instanceId: string;
927
- readonly operationId: string;
928
- readonly reconciledAt: string;
929
- readonly reconciledBy: string;
930
- readonly revision: number;
931
- readonly status: "aborted" | "completed";
932
- readonly toolId: string;
933
- readonly toolVersion: string;
934
- }
935
- interface RecoveryControl {
936
- inspect(): Effect.Effect<RecoverySnapshot, unknown>;
937
- requeueDeadLetter(input: {
938
- readonly actorId: string;
939
- readonly deliveryId: string;
940
- readonly endpointId: string;
941
- readonly expectedRevision: number;
942
- readonly note: string;
943
- }): Effect.Effect<DeadLetterRequeueResult, unknown>;
944
- resolveToolOperation(input: {
945
- readonly actorId: string;
946
- readonly expectedRevision: number;
947
- readonly instanceId: string;
948
- readonly note: string;
949
- readonly operationId: string;
950
- readonly outcome: RecoveryToolOperationOutcome;
951
- }): Effect.Effect<ToolOperationResolutionResult, unknown>;
952
- }
953
- //#endregion
954
- //#region src/adapters/compatibility/inbound-delivery/feishu-inbox-repository.d.ts
955
- interface FeishuInboxPendingState {
956
- readonly availableAt: string;
957
- readonly status: "pending";
958
- }
959
- interface FeishuInboxLeasedState {
960
- readonly leaseExpiresAt: string;
961
- readonly leaseId: string;
962
- readonly leasedAt: string;
963
- readonly status: "leased";
964
- }
965
- interface FeishuInboxCompletedState {
966
- readonly completedAt: string;
967
- readonly status: "completed";
968
- }
969
- interface FeishuInboxDeadState {
970
- readonly failedAt: string;
971
- readonly reason: string;
972
- readonly status: "dead";
973
- }
974
- type FeishuInboxDeliveryState = FeishuInboxPendingState | FeishuInboxLeasedState | FeishuInboxCompletedState | FeishuInboxDeadState;
975
- interface FeishuInboxDelivery {
976
- readonly acceptedAt: string;
977
- readonly attempts: number;
978
- readonly id: string;
979
- readonly laneKey: string;
980
- readonly options?: FeishuAgentDaemonHandleMessageOptions;
981
- readonly payload: FeishuReceiveMessagePayload;
982
- readonly recovery?: RecoveryAction;
983
- readonly revision: number;
984
- readonly state: FeishuInboxDeliveryState;
985
- }
986
- interface FeishuInboxClaimInput {
987
- readonly leaseExpiresAt: string;
988
- readonly leaseId: string;
989
- readonly now: string;
990
- }
991
- interface FeishuInboxClaimByIdInput extends FeishuInboxClaimInput {
992
- readonly id: string;
993
- }
994
- interface FeishuInboxCompleteInput {
995
- readonly completedAt: string;
996
- readonly id: string;
997
- readonly leaseId: string;
998
- }
999
- interface FeishuInboxFailInput {
1000
- readonly availableAt?: string;
1001
- readonly failedAt: string;
1002
- readonly id: string;
1003
- readonly leaseId: string;
1004
- readonly reason: string;
1005
- readonly terminal: boolean;
1006
- }
1007
- interface FeishuInboxReleaseInput {
1008
- readonly availableAt: string;
1009
- readonly id: string;
1010
- readonly leaseId: string;
1011
- }
1012
- interface FeishuInboxRepository {
1013
- admit(delivery: FeishuInboxDelivery, maxPending: number): Effect.Effect<"created" | "duplicate" | "capacity", unknown>;
1014
- claim(input: FeishuInboxClaimInput): Effect.Effect<FeishuInboxDelivery | undefined, unknown>;
1015
- claimById(input: FeishuInboxClaimByIdInput): Effect.Effect<FeishuInboxDelivery | undefined, unknown>;
1016
- complete(input: FeishuInboxCompleteInput): Effect.Effect<void, unknown>;
1017
- create(delivery: FeishuInboxDelivery): Effect.Effect<boolean, unknown>;
1018
- deadLetters(): ReadonlyArray<FeishuInboxDelivery>;
1019
- fail(input: FeishuInboxFailInput): Effect.Effect<void, unknown>;
1020
- pendingCount(): number;
1021
- requeueDeadLetter(input: {
1022
- readonly availableAt: string;
1023
- readonly expectedRevision: number;
1024
- readonly id: string;
1025
- readonly recovery: RecoveryAction;
1026
- }): Effect.Effect<FeishuInboxDelivery, unknown>;
1027
- release(input: FeishuInboxReleaseInput): Effect.Effect<void, unknown>;
1028
- }
1029
- interface FeishuInboxRepositoryStateOptions {
1030
- readonly initial?: ReadonlyArray<FeishuInboxDelivery>;
1031
- readonly persist?: (delivery: FeishuInboxDelivery) => Promise<void>;
1032
- }
1033
- declare function createFeishuInboxRepository(options?: FeishuInboxRepositoryStateOptions): FeishuInboxRepository;
1034
- //#endregion
1035
- //#region src/core/domain/tool-operation/value-objects/binding.d.ts
1036
- interface ToolOperationBinding$1 {
1037
- readonly agentId: string;
1038
- readonly inputDigest: string;
1039
- readonly instanceId: string;
1040
- readonly sourceMessageId: string;
1041
- readonly toolId: string;
1042
- readonly toolVersion: string;
1043
- }
1044
- //#endregion
1045
- //#region src/core/domain/tool-operation/aggregate/snapshot.d.ts
1046
- type ToolOperationState$1 = {
1047
- readonly status: "pending";
1048
- } | {
1049
- readonly result: unknown;
1050
- readonly status: "completed";
1051
- } | {
1052
- readonly reason: string;
1053
- readonly status: "reconciliation-required";
1054
- } | {
1055
- readonly status: "aborted";
1056
- };
1057
- interface ToolOperationReconciliationAction {
1058
- readonly actorId: string;
1059
- readonly at: string;
1060
- readonly note: string;
1061
- }
1062
- interface ToolOperationReconciliation$1 extends ToolOperationReconciliationAction {
1063
- readonly outcome: "applied" | "not-applied";
1064
- }
1065
- interface ToolOperationSnapshot {
1066
- readonly binding: ToolOperationBinding$1;
1067
- readonly operationId: string;
1068
- readonly reconciliation?: ToolOperationReconciliation$1;
1069
- readonly revision: number;
1070
- readonly state: ToolOperationState$1;
1071
- }
1072
- type ToolOperationRecord$1 = ToolOperationSnapshot;
1073
- type ToolOperationReconciliationOutcome$1 = {
1074
- readonly result: unknown;
1075
- readonly status: "applied";
1076
- } | {
1077
- readonly status: "not-applied";
1078
- };
1079
- type ToolOperationBeginResult$1 = {
1080
- readonly status: "acquired";
1081
- } | {
1082
- readonly result: unknown;
1083
- readonly status: "completed";
1084
- } | {
1085
- readonly status: "blocked";
1086
- readonly reason: string;
1087
- };
1088
- type ToolOperationInspectResult$1 = {
1089
- readonly status: "missing";
1090
- } | {
1091
- readonly result: unknown;
1092
- readonly status: "completed";
1093
- } | {
1094
- readonly status: "blocked";
1095
- readonly reason: string;
1096
- };
1097
- //#endregion
1098
- //#region src/adapters/compatibility/tool-execution/tool-operation-ledger.d.ts
1099
- interface ToolOperationBinding extends ToolOperationBinding$1 {}
1100
- type ToolOperationState = ToolOperationState$1;
1101
- interface ToolOperationReconciliation extends ToolOperationReconciliation$1 {}
1102
- interface ToolOperationRecord extends ToolOperationRecord$1 {}
1103
- type ToolOperationReconciliationOutcome = ToolOperationReconciliationOutcome$1;
1104
- type ToolOperationBeginResult = ToolOperationBeginResult$1;
1105
- type ToolOperationInspectResult = ToolOperationInspectResult$1;
1106
- interface ToolOperationLedger {
1107
- abort(operationId: string, binding: ToolOperationBinding): Promise<void>;
1108
- begin(operationId: string, binding: ToolOperationBinding): Promise<ToolOperationBeginResult>;
1109
- complete(operationId: string, binding: ToolOperationBinding, result: unknown): Promise<void>;
1110
- inspect(operationId: string, binding: ToolOperationBinding): Promise<ToolOperationInspectResult>;
1111
- reconciliationRequired(): ReadonlyArray<ToolOperationRecord>;
1112
- reconcile(input: {
1113
- readonly action: RecoveryAction;
1114
- readonly expectedRevision: number;
1115
- readonly operationId: string;
1116
- readonly outcome: ToolOperationReconciliationOutcome;
1117
- }): Promise<ToolOperationRecord>;
1118
- requireReconciliation(operationId: string, binding: ToolOperationBinding, reason: string): Promise<void>;
1119
- unresolvedForSource(sourceMessageId: string): ReadonlyArray<ToolOperationRecord>;
1120
- }
1121
- declare function createToolOperationLedger(options?: {
1122
- readonly initial?: ReadonlyArray<ToolOperationRecord>;
1123
- readonly persist?: (record: ToolOperationRecord) => Promise<void>;
1124
- }): ToolOperationLedger;
1125
- //#endregion
1126
- //#region src/adapters/compatibility/recovery/recovery-control.d.ts
1127
- interface RecoveryControlOptions {
1128
- readonly clock: {
1129
- readonly now: () => string;
1130
- };
1131
- readonly inboxes: ReadonlyArray<{
1132
- readonly endpointId: string;
1133
- readonly repository: FeishuInboxRepository;
1134
- }>;
1135
- readonly toolOperations: ReadonlyArray<{
1136
- readonly instanceId: string;
1137
- readonly ledger: ToolOperationLedger;
1138
- }>;
1139
- }
1140
- declare function createRecoveryControl(options: RecoveryControlOptions): RecoveryControl;
1141
- //#endregion
1142
- //#region src/core/application/recovery/commands/recovery-action.d.ts
1143
- declare class InvalidRecoveryAction extends Error {
1144
- readonly name = "InvalidRecoveryAction";
1145
- }
1146
- declare function createRecoveryAction(input: RecoveryAction): RecoveryAction;
1147
- //#endregion
1148
- //#region src/adapters/compatibility/inbound-delivery/jsonl-feishu-inbox-repository.d.ts
1149
- interface JsonlFeishuInboxRepositoryOptions {
1150
- readonly filePath: string;
1151
- }
1152
- declare function openJsonlFeishuInboxRepository(options: JsonlFeishuInboxRepositoryOptions): Promise<FeishuInboxRepository>;
1153
- //#endregion
1154
- //#region src/adapters/compatibility/conversation-session/json-feishu-session-store.d.ts
1155
- interface OpenJsonFeishuSessionStoreOptions {
1156
- readonly filePath: string;
1157
- }
1158
- declare function openJsonFeishuSessionStore(options: OpenJsonFeishuSessionStoreOptions): Promise<FeishuSessionStore>;
1159
- //#endregion
1160
- //#region src/core/application/agent-host/contracts/agent-instance.d.ts
1161
- type AgentInstanceBinding = {
1162
- readonly kind: "endpoint";
1163
- readonly endpointId: string;
1164
- } | {
1165
- readonly kind: "automation";
1166
- readonly automationId: string;
1167
- } | {
1168
- readonly kind: "background-session";
1169
- readonly agentId: string;
1170
- };
1171
- interface AgentInstanceRecord {
1172
- readonly agentId: string;
1173
- readonly binding: AgentInstanceBinding;
1174
- readonly bindingKey: string;
1175
- readonly instanceId: string;
1176
- readonly runtimeGenerationId: string;
1177
- }
1178
- //#endregion
1179
- //#region src/core/application/agent-host/contracts/agent-host-runtime.d.ts
1180
- interface AgentRuntimeInput$1 {
1181
- readonly invocation?: AgentInvocationOrigin;
1182
- readonly onUpdate?: (update: AgentRunUpdate) => Effect.Effect<void, unknown>;
1183
- readonly payload?: unknown;
1184
- readonly sessionKey: SessionKey;
1185
- readonly text: string;
1186
- }
1187
- interface AgentRuntimeCancellation$1 {
1188
- readonly reason?: string;
1189
- readonly runId: AgentRunId$1;
1190
- readonly sessionKey: SessionKey;
1191
- }
1192
- interface AgentRuntimeSteering$1 {
1193
- readonly runId: AgentRunId$1;
1194
- readonly sessionKey: SessionKey;
1195
- readonly text: string;
1196
- }
1197
- //#endregion
1198
- //#region src/adapters/agent/runtime/effect-agent-runtime-pool.d.ts
1199
- declare class AgentInstanceBusy extends Error {
1200
- readonly name = "AgentInstanceBusy";
1201
- }
1202
- declare class AgentRuntimeDisposed extends Error {
1203
- readonly name = "AgentRuntimeDisposed";
1204
- }
1205
- //#endregion
1206
- //#region src/core/application/agent-host/registry/agent-instance-registry.d.ts
1207
- interface AgentInstanceRegistryOptions {
1208
- readonly initialRecords?: ReadonlyArray<AgentInstanceRecord>;
1209
- }
1210
- declare class AgentInstanceConflict extends Error {
1211
- readonly name = "AgentInstanceConflict";
1212
- }
1213
- //#endregion
1214
- //#region src/adapters/compatibility/agent-host/agent-instance-registry.d.ts
1215
- interface AgentInstanceRegistry {
1216
- resolveAutomation(automationId: string, definition: ResolvedRivusAgentDefinition): AgentInstanceRecord;
1217
- resolveBackgroundSession(agentId: string, definition: ResolvedRivusAgentDefinition): AgentInstanceRecord;
1218
- resolveEndpoint(endpointId: string, definition: ResolvedRivusAgentDefinition): AgentInstanceRecord;
1219
- snapshot(): ReadonlyArray<AgentInstanceRecord>;
1220
- }
1221
- declare function createAgentInstanceRegistry(options?: AgentInstanceRegistryOptions): AgentInstanceRegistry;
1222
- //#endregion
1223
- //#region src/adapters/compatibility/agent-host/agent-runtime-pool.d.ts
1224
- interface AgentRuntimeInput {
1225
- readonly invocation?: AgentInvocationOrigin;
1226
- readonly onUpdate?: (update: AgentRunUpdate) => void | Promise<void>;
1227
- readonly payload?: unknown;
1228
- readonly sessionKey: SessionKey;
1229
- readonly text: string;
1230
- }
1231
- interface AgentRuntimeCancellation extends AgentRuntimeCancellation$1 {}
1232
- interface AgentRuntimeSteering extends AgentRuntimeSteering$1 {}
1233
- interface PooledAgentRuntime {
1234
- readonly concurrency?: "managed";
1235
- cancel?(input: AgentRuntimeCancellation): Promise<boolean>;
1236
- steer?(input: AgentRuntimeSteering): Promise<boolean>;
1237
- run(input: AgentRuntimeInput): Promise<unknown>;
1238
- dispose?(): Promise<void> | void;
1239
- }
1240
- interface AgentRuntimePoolOptions {
1241
- readonly disposeTimeoutMs?: number;
1242
- readonly registry: AgentInstanceRegistry;
1243
- readonly createRuntime: (instance: AgentInstanceRecord) => PooledAgentRuntime | Promise<PooledAgentRuntime>;
1244
- }
1245
- interface AgentRuntimePool {
1246
- readonly registry: AgentInstanceRegistry;
1247
- cancel(instance: AgentInstanceRecord, input: AgentRuntimeCancellation): Promise<boolean>;
1248
- steer(instance: AgentInstanceRecord, input: AgentRuntimeSteering): Promise<boolean>;
1249
- run(instance: AgentInstanceRecord, input: AgentRuntimeInput): Promise<unknown>;
1250
- disposeAll(): Promise<void>;
1251
- }
1252
- declare function createAgentRuntimePool(options: AgentRuntimePoolOptions): AgentRuntimePool;
1253
- //#endregion
1254
- //#region src/adapters/compatibility/agent-host/session-scheduler.d.ts
1255
- interface SessionSchedulerOptions {
1256
- readonly createRuntime: (sessionKey: string) => PooledAgentRuntime | Promise<PooledAgentRuntime>;
1257
- readonly maxConcurrentSessions: number;
1258
- readonly maxQueuedRuns: number;
1259
- }
1260
- interface SessionSchedulerStatus {
1261
- readonly activeSessions: number;
1262
- readonly queuedRuns: number;
1263
- readonly sessions: number;
1264
- }
1265
- interface SessionScheduler extends PooledAgentRuntime {
1266
- readonly concurrency: "managed";
1267
- status(): SessionSchedulerStatus;
1268
- }
1269
- declare class SessionSchedulerCapacityExceeded extends Error {
1270
- readonly name = "SessionSchedulerCapacityExceeded";
1271
- }
1272
- declare class SessionSchedulerDisposed extends Error {
1273
- readonly name = "SessionSchedulerDisposed";
1274
- }
1275
- declare function createSessionScheduler(options: SessionSchedulerOptions): SessionScheduler;
1276
- //#endregion
1277
- //#region src/adapters/http/client/json-fetch-request.d.ts
1278
- interface JsonHttpRequest {
1279
- readonly method: string;
1280
- readonly url: string;
1281
- readonly headers?: Readonly<Record<string, string>>;
1282
- readonly body?: unknown;
1283
- }
1284
- interface JsonHttpResponse {
1285
- readonly status: number;
1286
- readonly body: unknown;
1287
- }
1288
- interface FetchLikeResponse {
1289
- readonly status: number;
1290
- json(): Promise<unknown>;
1291
- }
1292
- type FetchLike = (url: string, init: {
1293
- readonly method: string;
1294
- readonly headers: Readonly<Record<string, string>>;
1295
- readonly body?: string;
1296
- readonly signal: AbortSignal;
1297
- }) => Promise<FetchLikeResponse>;
1298
- interface JsonFetchRequestOptions {
1299
- readonly fetch?: FetchLike;
1300
- }
1301
- declare function createJsonFetchRequest(options?: JsonFetchRequestOptions): (request: JsonHttpRequest) => Effect.Effect<JsonHttpResponse, unknown>;
1302
- //#endregion
1303
- //#region src/adapters/compatibility/agent-execution/runtime/agent-harness.d.ts
1304
- interface AgentHarnessOptions {
1305
- readonly loop: AgentLoop;
1306
- readonly runIds: RunIdGenerator;
1307
- readonly clock: AgentClock;
1308
- readonly runTimeoutMs?: number;
1309
- readonly initialRunStates?: ReadonlyArray<AgentRunState>;
1310
- readonly initialEvents?: ReadonlyArray<AgentDomainEvent>;
1311
- readonly eventSinks?: ReadonlyArray<AgentDomainEventSink>;
1312
- }
1313
- declare function createAgentHarness(options: AgentHarnessOptions): AgentHarness;
1314
- //#endregion
1315
- //#region src/adapters/compatibility/agent-execution/runtime/agent-callback-adapters.d.ts
1316
- type AgentDomainEventCallback = (event: AgentDomainEvent) => void | Promise<void>;
1317
- type AgentDomainEventSinkCallback = AgentDomainEventCallback;
1318
- type AgentRunUpdateCallback = (update: AgentRunUpdate) => void | Promise<void>;
1319
- declare function createAgentDomainEventSinkFromCallback(append: AgentDomainEventSinkCallback): AgentDomainEventSink;
1320
- declare function createAgentDomainEventHandler(handle: AgentDomainEventCallback): AgentDomainEventHandler;
1321
- declare function createAgentRunUpdateHandler(handle: AgentRunUpdateCallback): AgentRunUpdateHandler;
1322
- //#endregion
1323
- //#region src/adapters/compatibility/agent-execution/runtime/agent-harness-client.d.ts
1324
- interface AgentRunLookupClient {
1325
- getRunSummary(runId: AgentRunId$1): AgentRunSummary | undefined;
1326
- getRunUpdates(runId: AgentRunId$1): ReadonlyArray<AgentRunUpdate> | undefined;
1327
- getRunEvents(runId: AgentRunId$1): ReadonlyArray<AgentDomainEvent> | undefined;
1328
- getRunState(runId: AgentRunId$1): AgentRunState | undefined;
1329
- getRunSnapshot(runId: AgentRunId$1): AgentRunSnapshot | undefined;
1330
- }
1331
- interface AgentHarnessClient extends AgentRunLookupClient {
1332
- readonly harness: AgentHarness;
1333
- cancelActiveRun(reason?: string): Promise<boolean>;
1334
- cancelRun(runId: AgentRunId$1, reason?: string): Promise<boolean>;
1335
- forSession(sessionKey: SessionKey): AgentSessionClient;
1336
- getSessionHistory(sessionKey: SessionKey): AgentHistory;
1337
- getSessionTranscript(sessionKey: SessionKey): AgentTranscript;
1338
- getSessionSnapshot(sessionKey: SessionKey): AgentSessionSnapshot;
1339
- getSessionSummary(sessionKey: SessionKey): AgentSessionSummary | undefined;
1340
- getSessionState(sessionKey: SessionKey): AgentRunState | undefined;
1341
- getSessionRuns(sessionKey: SessionKey): ReadonlyArray<AgentRunSummary>;
1342
- getSessionLatestRunSummary(sessionKey: SessionKey): AgentRunSummary | undefined;
1343
- getSessionLatestRunSnapshot(sessionKey: SessionKey): AgentRunSnapshot | undefined;
1344
- getActiveRun(): ActiveAgentRun | undefined;
1345
- getActiveRunId(): AgentRunId$1 | undefined;
1346
- getActiveRunState(): AgentRunState | undefined;
1347
- getAvailability(): AgentHarnessAvailability;
1348
- getHistory(): AgentHistory;
1349
- getState(): AgentRunState;
1350
- prompt(command: PromptCommand): Promise<AgentPromptResult>;
1351
- promptRunSnapshot(command: PromptCommand): Promise<AgentRunSnapshot>;
1352
- promptSnapshot(command: PromptCommand): Promise<AgentSessionSnapshot>;
1353
- promptText(command: PromptCommand): Promise<string>;
1354
- promptTurn(command: PromptCommand): Promise<AgentTranscriptTurn>;
1355
- promptWithEvents(command: PromptCommand, onEvent: AgentDomainEventCallback): Promise<AgentPromptResult>;
1356
- promptWithText(command: PromptCommand, onTextDelta: AgentTextDeltaCallback): Promise<AgentPromptResult>;
1357
- promptWithUpdates(command: PromptCommand, onUpdate: AgentRunUpdateCallback): Promise<AgentPromptResult>;
1358
- stream(command: PromptCommand): AsyncIterable<AgentDomainEvent>;
1359
- streamText(command: PromptCommand): AsyncIterable<string>;
1360
- streamUpdates(command: PromptCommand): AsyncIterable<AgentRunUpdate>;
1361
- subscribe(listener: AgentDomainEventListener): () => void;
1362
- subscribeRun(runId: AgentRunId$1, listener: AgentDomainEventListener): () => void;
1363
- subscribeRunUpdates(runId: AgentRunId$1, listener: AgentRunUpdateListener): () => void;
1364
- subscribeUpdates(listener: AgentRunUpdateListener): () => void;
1365
- tryPrompt(command: PromptCommand): Promise<AgentClientAttempt<AgentPromptResult, unknown>>;
1366
- tryPromptText(command: PromptCommand): Promise<AgentClientAttempt<string, unknown>>;
1367
- }
1368
- interface AgentSessionClient extends AgentRunLookupClient {
1369
- readonly handle: AgentSessionHandle;
1370
- readonly sessionKey: SessionKey;
1371
- cancelActiveRun(reason?: string): Promise<boolean>;
1372
- cancelRun(runId: AgentRunId$1, reason?: string): Promise<boolean>;
1373
- getSnapshot(): AgentSessionSnapshot;
1374
- getState(): AgentRunState | undefined;
1375
- getSummary(): AgentSessionSummary | undefined;
1376
- getTranscript(): AgentTranscript;
1377
- getRuns(): ReadonlyArray<AgentRunSummary>;
1378
- getLatestRunSnapshot(): AgentRunSnapshot | undefined;
1379
- getLatestRunSummary(): AgentRunSummary | undefined;
1380
- getActiveRun(): ActiveAgentRun | undefined;
1381
- getActiveRunState(): AgentRunState | undefined;
1382
- getAvailability(): AgentSessionAvailability;
1383
- getHistory(): AgentHistory;
1384
- prompt(text: string): Promise<AgentPromptResult>;
1385
- promptRunSnapshot(text: string): Promise<AgentRunSnapshot>;
1386
- promptSnapshot(text: string): Promise<AgentSessionSnapshot>;
1387
- promptText(text: string): Promise<string>;
1388
- promptTurn(text: string): Promise<AgentTranscriptTurn>;
1389
- promptWithEvents(text: string, onEvent: AgentDomainEventCallback): Promise<AgentPromptResult>;
1390
- promptWithText(text: string, onTextDelta: AgentTextDeltaCallback): Promise<AgentPromptResult>;
1391
- promptWithUpdates(text: string, onUpdate: AgentRunUpdateCallback): Promise<AgentPromptResult>;
1392
- stream(text: string): AsyncIterable<AgentDomainEvent>;
1393
- streamText(text: string): AsyncIterable<string>;
1394
- streamUpdates(text: string): AsyncIterable<AgentRunUpdate>;
1395
- subscribe(listener: AgentDomainEventListener): () => void;
1396
- subscribeRun(runId: AgentRunId$1, listener: AgentDomainEventListener): () => void;
1397
- subscribeRunUpdates(runId: AgentRunId$1, listener: AgentRunUpdateListener): () => void;
1398
- subscribeUpdates(listener: AgentRunUpdateListener): () => void;
1399
- tryPrompt(text: string): Promise<AgentClientAttempt<AgentPromptResult, unknown>>;
1400
- tryPromptText(text: string): Promise<AgentClientAttempt<string, unknown>>;
1401
- }
1402
- type AgentTextDeltaCallback = (delta: string) => void | Promise<void>;
1403
- type AgentClientAttempt<T, E = unknown> = AgentClientSuccess<T> | AgentClientFailure<E>;
1404
- interface AgentClientSuccess<T> {
1405
- readonly ok: true;
1406
- readonly value: T;
1407
- }
1408
- interface AgentClientFailure<E = unknown> {
1409
- readonly ok: false;
1410
- readonly error: E;
1411
- }
1412
- declare function createAgentHarnessClient(harness: AgentHarness): AgentHarnessClient;
1413
- //#endregion
1414
- //#region src/adapters/compatibility/agent-execution/runtime/agent-runtime-primitives.d.ts
1415
- type DefaultAgentHarnessOptions = Omit<AgentHarnessOptions, "clock" | "runIds"> & {
1416
- readonly clock?: AgentClock;
1417
- readonly runIds?: RunIdGenerator;
1418
- };
1419
- type DefaultAgentHarnessFromCallbackOptions = Omit<DefaultAgentHarnessOptions, "loop">;
1420
- type DefaultAgentHarnessFromTextCallbackOptions = DefaultAgentHarnessFromCallbackOptions;
1421
- type DefaultAgentHarnessClientOptions = DefaultAgentHarnessOptions;
1422
- type DefaultAgentHarnessClientFromCallbackOptions = DefaultAgentHarnessFromCallbackOptions;
1423
- type DefaultAgentHarnessClientFromTextCallbackOptions = DefaultAgentHarnessFromTextCallbackOptions;
1424
- interface DefaultAgentRuntimeSessionOptions {
1425
- readonly mainSessionKey?: SessionKey;
1426
- }
1427
- interface AgentRuntime {
1428
- readonly client: AgentHarnessClient;
1429
- readonly harness: AgentHarness;
1430
- readonly mainClient: AgentSessionClient;
1431
- readonly mainSession: AgentSessionHandle;
1432
- readonly mainSessionKey: SessionKey;
1433
- forSession(sessionKey: SessionKey): AgentSessionHandle;
1434
- forSessionClient(sessionKey: SessionKey): AgentSessionClient;
1435
- prompt(text: string): Promise<AgentPromptResult>;
1436
- promptText(text: string): Promise<string>;
1437
- promptTurn(text: string): Promise<AgentTranscriptTurn>;
1438
- tryPrompt(text: string): Promise<AgentClientAttempt<AgentPromptResult, unknown>>;
1439
- tryPromptText(text: string): Promise<AgentClientAttempt<string, unknown>>;
1440
- }
1441
- type DefaultAgentRuntimeOptions = DefaultAgentHarnessOptions;
1442
- type DefaultAgentRuntimeFromCallbackOptions = DefaultAgentHarnessFromCallbackOptions;
1443
- type DefaultAgentRuntimeFromTextCallbackOptions = DefaultAgentHarnessFromTextCallbackOptions;
1444
- declare function createDefaultAgentHarness(options: DefaultAgentHarnessOptions): AgentHarness;
1445
- declare function createDefaultAgentHarnessFromCallback(run: AgentLoopCallback, options?: DefaultAgentHarnessFromCallbackOptions): AgentHarness;
1446
- declare function createDefaultAgentHarnessFromTextCallback(generate: TextAgentLoopCallback, options?: DefaultAgentHarnessFromTextCallbackOptions): AgentHarness;
1447
- declare function createDefaultAgentHarnessClient(options: DefaultAgentHarnessClientOptions): AgentHarnessClient;
1448
- declare function createDefaultAgentHarnessClientFromCallback(run: AgentLoopCallback, options?: DefaultAgentHarnessClientFromCallbackOptions): AgentHarnessClient;
1449
- declare function createDefaultAgentHarnessClientFromTextCallback(generate: TextAgentLoopCallback, options?: DefaultAgentHarnessClientFromTextCallbackOptions): AgentHarnessClient;
1450
- declare function createDefaultAgentRuntime(options: DefaultAgentRuntimeOptions, runtimeOptions?: DefaultAgentRuntimeSessionOptions): AgentRuntime;
1451
- declare function createDefaultAgentRuntimeFromCallback(run: AgentLoopCallback, options?: DefaultAgentRuntimeFromCallbackOptions, runtimeOptions?: DefaultAgentRuntimeSessionOptions): AgentRuntime;
1452
- declare function createDefaultAgentRuntimeFromTextCallback(generate: TextAgentLoopCallback, options?: DefaultAgentRuntimeFromTextCallbackOptions, runtimeOptions?: DefaultAgentRuntimeSessionOptions): AgentRuntime;
1453
- declare function createSystemClock(): AgentClock;
1454
- declare function createUuidRunIds(): RunIdGenerator;
1455
- declare function createAgentRuntime(harness: AgentHarness, options?: DefaultAgentRuntimeSessionOptions): AgentRuntime;
1456
- //#endregion
1457
- //#region src/platform/home/config/runtime/rivus-daemon-config.d.ts
1458
- type RivusDaemonEnv = Readonly<Record<string, string | undefined>>;
1459
- type RivusThinkingLevel = "off" | "minimal" | "low" | "medium" | "high" | "xhigh";
1460
- type RivusTextFileReader = (path: string) => Promise<string> | string;
1461
- interface RivusDaemonConfigLoaderOptions {
1462
- readonly readTextFile?: RivusTextFileReader;
1463
- }
1464
- interface RivusDaemonConfig {
1465
- readonly agentId: string;
1466
- readonly feishu: {
1467
- readonly appId: string;
1468
- readonly appSecret: string;
1469
- readonly baseUrl: string;
1470
- readonly cardStreamLeaseMs: number;
1471
- readonly streamMinIntervalMs: number;
1472
- };
1473
- readonly pi: {
1474
- readonly apiKey?: string;
1475
- readonly baseUrl?: string;
1476
- readonly model?: string;
1477
- readonly thinkingLevel?: RivusThinkingLevel;
1478
- };
1479
- }
1480
- declare class RivusDaemonConfigError {
1481
- readonly variable: string;
1482
- readonly message: string;
1483
- readonly _tag = "RivusDaemonConfigError";
1484
- constructor(variable: string, message: string);
1485
- }
1486
- declare function loadRivusDaemonConfig(env: RivusDaemonEnv, options?: RivusDaemonConfigLoaderOptions): Effect.Effect<RivusDaemonConfig, RivusDaemonConfigError>;
1487
- //#endregion
1488
- //#region src/adapters/feishu/config/feishu-endpoint-credentials.d.ts
1489
- interface FeishuEndpointCredentials {
1490
- readonly appId: string;
1491
- readonly appSecret: string;
1492
- }
1493
- declare class FeishuEndpointCredentialError extends Error {
1494
- readonly name = "FeishuEndpointCredentialError";
1495
- }
1496
- declare function resolveFeishuEndpointCredentials(credentialRef: string, env: RivusDaemonEnv): FeishuEndpointCredentials;
1497
- //#endregion
1498
- //#region src/adapters/openclaw/config/openclaw-env-import.d.ts
1499
- type RivusEnvFileVariables = Readonly<Record<string, string>>;
1500
- interface OpenClawEnvImportOptions {
1501
- readonly feishuBaseUrl?: string;
1502
- readonly piApiKeyFile?: string;
1503
- readonly streamMinIntervalMs?: number;
1504
- }
1505
- interface OpenClawEnvImportResult {
1506
- readonly env: RivusEnvFileVariables;
1507
- readonly warnings: ReadonlyArray<string>;
1508
- }
1509
- declare class OpenClawEnvImportError extends Error {
1510
- constructor(message: string);
1511
- }
1512
- declare function createRivusEnvFromOpenClawConfig(openClawConfig: unknown, options?: OpenClawEnvImportOptions): OpenClawEnvImportResult;
1513
- declare function formatRivusEnvFile(env: RivusEnvFileVariables): string;
1514
- //#endregion
1515
- //#region src/adapters/pi/config/pi-model-overrides.d.ts
1516
- interface MergePiProviderBaseUrlOverrideOptions {
1517
- readonly baseUrl: string;
1518
- readonly filePath: string;
1519
- readonly provider: string;
1520
- }
1521
- declare function mergePiProviderBaseUrlOverride(options: MergePiProviderBaseUrlOverrideOptions): Promise<void>;
1522
- //#endregion
1523
- //#region src/platform/durable-queue/processing/durable-queue.d.ts
1524
- interface DurableQueuePreparedAction<Result> {
1525
- execute(): Effect.Effect<Result | undefined, unknown>;
1526
- }
1527
- //#endregion
1528
- //#region src/adapters/feishu/inbound-delivery/feishu-inbound-delivery.d.ts
1529
- type FeishuMessageAcceptResult = {
1530
- readonly accepted: true;
1531
- readonly messageId: string;
1532
- readonly pending: number;
1533
- } | {
1534
- readonly accepted: false;
1535
- readonly messageId: string;
1536
- readonly pending: number;
1537
- readonly reason: "capacity" | "duplicate" | "ignored";
1538
- };
1539
- //#endregion
1540
- //#region src/adapters/compatibility/inbound-delivery/feishu-message-queue.d.ts
1541
- interface FeishuMessageQueueOptions {
1542
- readonly clock?: {
1543
- readonly now: () => string;
1544
- };
1545
- /**
1546
- * Applies cancellation, session reset, or steering immediately after the
1547
- * message is durably admitted. Returning undefined leaves it on the prompt
1548
- * lane; returning a result completes the durable delivery.
1549
- */
1550
- readonly handleControl?: (payload: FeishuReceiveMessagePayload) => Effect.Effect<FeishuAgentDaemonHandleResult | undefined, unknown>;
1551
- readonly handleMessage: (payload: FeishuReceiveMessagePayload, options?: FeishuAgentDaemonHandleMessageOptions) => Effect.Effect<FeishuAgentDaemonHandleResult, unknown>;
1552
- readonly shouldRetryError?: (error: unknown) => boolean;
1553
- readonly leaseMs?: number;
1554
- readonly maxAttempts?: number;
1555
- readonly maxPending?: number;
1556
- readonly prepareControl?: (payload: FeishuReceiveMessagePayload) => Effect.Effect<FeishuMessagePreparedControl | undefined, unknown>;
1557
- readonly repository?: FeishuInboxRepository;
1558
- readonly retryDelayMs?: number;
1559
- /**
1560
- * Identifies a delivery that belongs to a run which was interrupted before
1561
- * the process restarted. Such a delivery is completed as a duplicate rather
1562
- * than starting the same user prompt a second time.
1563
- */
1564
- readonly shouldSkipReplay?: (payload: FeishuReceiveMessagePayload) => Effect.Effect<boolean, unknown>;
1565
- }
1566
- type FeishuMessagePreparedControl = DurableQueuePreparedAction<FeishuAgentDaemonHandleResult>;
1567
- type FeishuMessageDrainResult = {
1568
- readonly handled: true;
1569
- readonly messageId: string;
1570
- readonly result: FeishuAgentDaemonHandleResult;
1571
- } | {
1572
- readonly handled: false;
1573
- readonly reason: "empty";
1574
- };
1575
- interface FeishuMessageQueue {
1576
- accept(payload: FeishuReceiveMessagePayload, options?: FeishuAgentDaemonHandleMessageOptions): Effect.Effect<FeishuMessageAcceptResult, unknown>;
1577
- drainOne(): Effect.Effect<FeishuMessageDrainResult, unknown>;
1578
- deadLetters(): ReadonlyArray<FeishuInboxDelivery>;
1579
- pending(): number;
1580
- }
1581
- declare function createFeishuMessageQueue(options: FeishuMessageQueueOptions): FeishuMessageQueue;
1582
- //#endregion
1583
- //#region src/adapters/feishu/intake/feishu-group-policy.d.ts
1584
- type FeishuEndpointGroupPolicy = "mention-only" | "ignore-unmentioned" | "default-responder";
1585
- declare function shouldAcceptFeishuEndpointMessage(payload: FeishuReceiveMessagePayload, policy: FeishuEndpointGroupPolicy, botOpenId: string): boolean;
1586
- //#endregion
1587
- //#region src/adapters/feishu/runtime/feishu-receive-status.d.ts
1588
- type FeishuReceiveMessageReplayOptions = FeishuAgentDaemonHandleMessageOptions;
1589
- interface FeishuReceiveMessageSummary {
1590
- readonly chatId: string;
1591
- readonly messageId: string;
1592
- readonly tenantKey?: string;
1593
- readonly threadId?: string;
1594
- }
1595
- interface FeishuReceiveAcceptedObservation {
1596
- readonly accepted: FeishuMessageAcceptResult;
1597
- readonly message: FeishuReceiveMessageSummary;
1598
- readonly observedAt: Date;
1599
- }
1600
- interface FeishuReceiveHandledObservation {
1601
- readonly intake: FeishuMessageIntakeSummary;
1602
- readonly messageId: string;
1603
- readonly observedAt: Date;
1604
- readonly result: FeishuAgentDaemonHandleResult;
1605
- }
1606
- interface FeishuReceiveRuntimeStatus {
1607
- readonly lastAccepted?: FeishuReceiveAcceptedObservation;
1608
- readonly lastHandled?: FeishuReceiveHandledObservation;
1609
- }
1610
- interface FeishuMessageWorkerDrainAvailableResult {
1611
- readonly drained: number;
1612
- readonly results: ReadonlyArray<{
1613
- readonly handled: true;
1614
- readonly messageId: string;
1615
- readonly result: FeishuAgentDaemonHandleResult;
1616
- }>;
1617
- }
1618
- interface FeishuReceiveMessageReplayResult {
1619
- readonly accepted: FeishuMessageAcceptResult;
1620
- readonly drained: FeishuMessageWorkerDrainAvailableResult;
1621
- readonly intake: FeishuMessageIntakeSummary;
1622
- }
1623
- //#endregion
1624
- //#region src/adapters/compatibility/inbound-delivery/feishu-message-worker.d.ts
1625
- interface FeishuMessageWorkerQueue {
1626
- drainOne(): Effect.Effect<FeishuMessageDrainResult, unknown>;
1627
- pending(): number;
1628
- }
1629
- interface FeishuMessageWorker {
1630
- drainAvailable(): Effect.Effect<FeishuMessageWorkerDrainAvailableResult, unknown>;
1631
- }
1632
- interface FeishuMessageWorkerOptions {
1633
- readonly concurrency?: number;
1634
- readonly queue: FeishuMessageWorkerQueue;
1635
- }
1636
- declare function createFeishuMessageWorker(options: FeishuMessageWorkerOptions): FeishuMessageWorker;
1637
- //#endregion
1638
- //#region src/platform/concurrency/periodic-effect-loop.d.ts
1639
- interface PeriodicEffectLoop {
1640
- running(): boolean;
1641
- start(): void;
1642
- stop(): Promise<void>;
1643
- }
1644
- //#endregion
1645
- //#region src/adapters/compatibility/inbound-delivery/feishu-worker-loop.d.ts
1646
- interface FeishuWorkerLoopOptions {
1647
- readonly drainAvailable: () => Effect.Effect<unknown, unknown>;
1648
- readonly intervalMs: number;
1649
- readonly onError?: (error: unknown) => void | Promise<void>;
1650
- readonly sleep: (ms: number) => Effect.Effect<void, unknown>;
1651
- }
1652
- type FeishuWorkerLoop = PeriodicEffectLoop;
1653
- declare function createFeishuWorkerLoop(options: FeishuWorkerLoopOptions): FeishuWorkerLoop;
1654
- //#endregion
1655
- //#region src/platform/daemon/process/rivus-daemon-process.d.ts
1656
- interface RivusDaemonTransport {
1657
- running(): boolean;
1658
- start(): Promise<void> | void;
1659
- stop(): Promise<void> | void;
1660
- }
1661
- interface RivusDaemonWorkerLoop {
1662
- running(): boolean;
1663
- start(): void;
1664
- stop(): Promise<void> | void;
1665
- }
1666
- interface RivusDaemonProcessOptions {
1667
- readonly transport: RivusDaemonTransport;
1668
- readonly workerLoop: RivusDaemonWorkerLoop;
1669
- }
1670
- interface RivusDaemonProcess {
1671
- running(): boolean;
1672
- start(): Effect.Effect<void, unknown>;
1673
- stop(): Effect.Effect<void, unknown>;
1674
- }
1675
- declare function createRivusDaemonProcess(options: RivusDaemonProcessOptions): RivusDaemonProcess;
1676
- //#endregion
1677
- //#region src/platform/daemon/transport/rivus-daemon-transport.d.ts
1678
- interface CompositeRivusDaemonTransportOptions {
1679
- readonly transports: ReadonlyArray<RivusDaemonTransport>;
1680
- }
1681
- declare function createCompositeRivusDaemonTransport(options: CompositeRivusDaemonTransportOptions): RivusDaemonTransport;
1682
- //#endregion
1683
- //#region src/core/application/card-presentation/projection/card-presentation.d.ts
1684
- type CardPresentationStatus = "streaming" | "handoff-pending" | "active" | "closed" | "terminal";
1685
- interface CardPresentation {
1686
- readonly runId: string;
1687
- readonly presentationId: string;
1688
- readonly generation: number;
1689
- readonly cardId: string;
1690
- readonly elementId?: string;
1691
- readonly sourceMessageId: string;
1692
- readonly status: CardPresentationStatus;
1693
- readonly createdAt: string;
1694
- readonly leaseDeadlineAt: string;
1695
- readonly handoffAt?: string;
1696
- readonly handoffFailedAt?: string;
1697
- readonly predecessorPresentationId?: string;
1698
- readonly successorPresentationId?: string;
1699
- readonly terminalReceiptId?: string;
1700
- }
1701
- interface CardPresentationChain {
1702
- readonly runId: string;
1703
- readonly activeGeneration: number;
1704
- readonly activePresentationId: string;
1705
- readonly presentations: ReadonlyArray<CardPresentation>;
1706
- readonly revision: number;
1707
- }
1708
- interface CardPresentationBinding {
1709
- readonly cardId: string;
1710
- readonly createdAt: string;
1711
- readonly elementId?: string;
1712
- readonly leaseDeadlineAt: string;
1713
- readonly presentationId: string;
1714
- readonly runId: string;
1715
- readonly sourceMessageId: string;
1716
- }
1717
- interface CardPresentationSuccessor {
1718
- readonly cardId: string;
1719
- readonly createdAt: string;
1720
- readonly elementId?: string;
1721
- readonly leaseDeadlineAt: string;
1722
- readonly presentationId: string;
1723
- }
1724
- declare class CardPresentationTransitionDenied extends Error {
1725
- readonly name = "CardPresentationTransitionDenied";
1726
- }
1727
- declare function activeCardPresentation(chain: CardPresentationChain): CardPresentation;
1728
- declare function acceptsCardPresentationProgress(chain: CardPresentationChain): boolean;
1729
- declare function isCardPresentationHandoffDue(chain: CardPresentationChain, now: string): boolean;
1730
- //#endregion
1731
- //#region src/adapters/feishu/card-presentation/feishu-card-presentation-store.d.ts
1732
- interface FeishuCardPresentationHandoffStart {
1733
- readonly presentation: CardPresentation;
1734
- readonly started: boolean;
1735
- }
1736
- interface FeishuCardPresentationStore {
1737
- bind(binding: CardPresentationBinding): Effect.Effect<CardPresentation, unknown>;
1738
- beginHandoff(input: {
1739
- readonly handoffAt: string;
1740
- readonly runId: string;
1741
- }): Effect.Effect<FeishuCardPresentationHandoffStart, unknown>;
1742
- chain(runId: string): CardPresentationChain | undefined;
1743
- chains(): ReadonlyArray<CardPresentationChain>;
1744
- compensateInterruptedHandoffs(compensatedAt: string): Effect.Effect<ReadonlyArray<CardPresentationChain>, unknown>;
1745
- completeHandoff(input: {
1746
- readonly runId: string;
1747
- readonly successor: CardPresentationSuccessor;
1748
- }): Effect.Effect<CardPresentation, unknown>;
1749
- failHandoff(input: {
1750
- readonly failedAt: string;
1751
- readonly runId: string;
1752
- }): Effect.Effect<void, unknown>;
1753
- markTerminal(input: {
1754
- readonly runId: string;
1755
- readonly terminalReceiptId: string;
1756
- }): Effect.Effect<void, unknown>;
1757
- release(runId: string): Effect.Effect<void, unknown>;
1758
- size(): number;
1759
- }
1760
- //#endregion
1761
- //#region src/core/application/card-presentation/projection/card-presentation-lease.d.ts
1762
- declare const DEFAULT_CARD_STREAM_LEASE_MS = 510000;
1763
- //#endregion
1764
- //#region src/adapters/feishu/card-presentation/rollover/feishu-card-rollover.d.ts
1765
- interface FeishuCardRolloverTarget {
1766
- readonly cardId: string;
1767
- readonly elementId?: string;
1768
- }
1769
- interface FeishuCardRolloverSuccessorRequest {
1770
- readonly generation: number;
1771
- readonly presentationId: string;
1772
- readonly run: FeishuAgentRunPreparation;
1773
- }
1774
- interface FeishuCardRolloverStreamPublisher {
1775
- flush(runId?: string): Effect.Effect<void, unknown>;
1776
- publish(action: FeishuStreamAction): Effect.Effect<void, unknown>;
1777
- }
1778
- type FeishuCardRolloverEventType = "handoff_started" | "handoff_succeeded" | "handoff_failed" | "handoff_notice_failed" | "presentation_write_failed" | "stale_update_dropped" | "stream_closed" | "terminal_delivery_failed";
1779
- interface FeishuCardRolloverEvent {
1780
- readonly at?: string;
1781
- readonly cardId?: string;
1782
- readonly error?: unknown;
1783
- readonly generation?: number;
1784
- readonly presentationId?: string;
1785
- readonly runId?: string;
1786
- readonly sourceMessageId?: string;
1787
- readonly successorCardId?: string;
1788
- readonly type: FeishuCardRolloverEventType;
1789
- }
1790
- type FeishuCardRolloverCounters = Readonly<Record<FeishuCardRolloverEventType, number>>;
1791
- interface FeishuCardRolloverStatus {
1792
- readonly counters: FeishuCardRolloverCounters;
1793
- readonly leaseMs: number;
1794
- readonly live: ReadonlyArray<CardPresentation>;
1795
- }
1796
- type FeishuCardRolloverHandoffResult = {
1797
- readonly presentation: CardPresentation;
1798
- readonly status: "rolled-over";
1799
- } | {
1800
- readonly reason: "already-pending" | "not-due" | "not-live" | "not-streaming";
1801
- readonly status: "skipped";
1802
- } | {
1803
- readonly error: unknown;
1804
- readonly status: "failed";
1805
- };
1806
- interface FeishuCardRolloverOptions {
1807
- readonly clock: AgentClock;
1808
- readonly createSuccessor: (request: FeishuCardRolloverSuccessorRequest) => Effect.Effect<FeishuCardRolloverTarget, unknown>;
1809
- readonly leaseMs?: number;
1810
- readonly observe?: (event: FeishuCardRolloverEvent) => void;
1811
- readonly progressDisplay?: ConversationProgressDisplay;
1812
- readonly publisher: FeishuCardRolloverStreamPublisher;
1813
- readonly store: FeishuCardPresentationStore;
1814
- }
1815
- interface FeishuCardRollover extends FeishuCardRolloverStreamPublisher {
1816
- bindRun(run: FeishuAgentRunPreparation, target: FeishuCardRolloverTarget): Effect.Effect<CardPresentation, unknown>;
1817
- dueRunIds(now: Date): ReadonlyArray<string>;
1818
- handoff(runId: string): Effect.Effect<FeishuCardRolloverHandoffResult, unknown>;
1819
- observeStreamClosed(cardId: string): void;
1820
- recover(): Effect.Effect<{
1821
- readonly compensated: number;
1822
- }, unknown>;
1823
- releaseRun(runId: string): Effect.Effect<void>;
1824
- status(): FeishuCardRolloverStatus;
1825
- }
1826
- declare function createFeishuCardRollover(options: FeishuCardRolloverOptions): FeishuCardRollover;
1827
- //#endregion
1828
- //#region src/adapters/compatibility/daemon/rivus-daemon-status.d.ts
1829
- interface RivusDaemonStatus {
1830
- readonly agentId: string;
1831
- readonly cards?: FeishuCardRolloverStatus;
1832
- readonly harness: {
1833
- readonly activeRunId?: AgentRunId$1;
1834
- readonly activeRunState?: AgentRunState;
1835
- readonly activeSessionKey?: SessionKey;
1836
- readonly busy: boolean;
1837
- };
1838
- readonly history: AgentHistory;
1839
- readonly process: {
1840
- readonly running: boolean;
1841
- };
1842
- readonly queue: {
1843
- readonly pending: number;
1844
- };
1845
- readonly receive?: FeishuReceiveRuntimeStatus;
1846
- readonly transport: {
1847
- readonly running: boolean;
1848
- };
1849
- readonly workerLoop: {
1850
- readonly running: boolean;
1851
- };
1852
- }
1853
- interface RivusDaemonStatusReporter {
1854
- status(): Effect.Effect<RivusDaemonStatus, unknown>;
1855
- }
1856
- interface RivusDaemonStatusReporterOptions {
1857
- readonly activeRun?: () => ActiveAgentRun | undefined;
1858
- readonly cardPresentations?: () => FeishuCardRolloverStatus;
1859
- readonly activeRunId?: () => AgentRunId$1 | undefined;
1860
- readonly activeRunState?: () => AgentRunState | undefined;
1861
- readonly agentId: string;
1862
- readonly availability?: () => AgentHarnessAvailability;
1863
- readonly pending: () => number;
1864
- readonly processRunning: () => boolean;
1865
- readonly receiveStatus?: () => FeishuReceiveRuntimeStatus;
1866
- readonly restoreHistory: () => Effect.Effect<AgentHistory, unknown>;
1867
- readonly transportRunning: () => boolean;
1868
- readonly workerLoopRunning: () => boolean;
1869
- }
1870
- declare function createRivusDaemonStatusReporter(options: RivusDaemonStatusReporterOptions): RivusDaemonStatusReporter;
1871
- //#endregion
1872
- //#region src/adapters/compatibility/daemon/rivus-daemon-status-http-server.d.ts
1873
- interface RivusDaemonStatusHttpServerOptions {
1874
- readonly host?: string;
1875
- readonly path?: string;
1876
- readonly port: number;
1877
- readonly statusReporter: RivusDaemonStatusReporter;
1878
- }
1879
- interface RivusDaemonStatusHttpServer extends RivusDaemonTransport {
1880
- url(): string | undefined;
1881
- }
1882
- declare function createRivusDaemonStatusHttpServer(options: RivusDaemonStatusHttpServerOptions): RivusDaemonStatusHttpServer;
1883
- //#endregion
1884
- //#region src/platform/daemon/process/rivus-daemon-shutdown-controller.d.ts
1885
- type RivusDaemonShutdownSignal = "SIGINT" | "SIGTERM";
1886
- interface RivusDaemonSignalSource {
1887
- on(signal: RivusDaemonShutdownSignal, listener: () => void): void;
1888
- }
1889
- interface RivusDaemonShutdownControllerOptions {
1890
- readonly daemon: Pick<RivusDaemonProcess, "stop">;
1891
- readonly signalSource: RivusDaemonSignalSource;
1892
- readonly signals?: ReadonlyArray<RivusDaemonShutdownSignal>;
1893
- readonly onError?: (error: unknown, signal: RivusDaemonShutdownSignal) => void | Promise<void>;
1894
- readonly onStopped?: (signal: RivusDaemonShutdownSignal) => void | Promise<void>;
1895
- }
1896
- interface RivusDaemonShutdownController {
1897
- handle(signal: RivusDaemonShutdownSignal): Promise<void>;
1898
- install(): void;
1899
- stopping(): boolean;
1900
- }
1901
- declare function createRivusDaemonShutdownController(options: RivusDaemonShutdownControllerOptions): RivusDaemonShutdownController;
1902
- //#endregion
1903
- //#region src/adapters/agent/runtime/process-agent-runtime-adapter.d.ts
1904
- interface ProcessAgentRuntimeInput extends Omit<AgentRuntimeInput$1, "onUpdate"> {
1905
- readonly onUpdate?: (update: AgentRunUpdate) => void | Promise<void>;
1906
- }
1907
- interface ProcessAgentRuntime {
1908
- readonly concurrency?: "managed";
1909
- cancel?(input: AgentRuntimeCancellation$1): Promise<boolean>;
1910
- dispose?(): Promise<void> | void;
1911
- run(input: ProcessAgentRuntimeInput): Promise<unknown>;
1912
- steer?(input: AgentRuntimeSteering$1): Promise<boolean>;
1913
- }
1914
- //#endregion
1915
- //#region src/core/application/automation/policy/automation-mandate.d.ts
1916
- interface AutomationBinding {
1917
- readonly agentId: string;
1918
- readonly bindingId: string;
1919
- readonly delivery: AutomationDeliveryBinding;
1920
- readonly schedule: string;
1921
- readonly servicePrincipalId: string;
1922
- readonly skillGrantRevision: string;
1923
- readonly skillIds: ReadonlyArray<string>;
1924
- readonly templateId: string;
1925
- readonly timeZone: string;
1926
- readonly toolIds: ReadonlyArray<string>;
1927
- }
1928
- interface AutomationDeliveryBinding {
1929
- readonly endpointId: string;
1930
- readonly targetKey: string;
1931
- readonly targetType: "chat_id" | "open_id" | "user_id" | "union_id" | "email";
1932
- }
1933
- interface AutomationMandate extends AutomationBinding {
1934
- readonly id: string;
1935
- readonly active: boolean;
1936
- }
1937
- interface AutomationTick {
1938
- readonly tickId: string;
1939
- readonly mandateId: string;
1940
- readonly occurrence: string;
1941
- readonly claimedBy: string;
1942
- }
1943
- interface AutomationMandateStore {
1944
- activate(binding: AutomationBinding): AutomationMandate;
1945
- revoke(id: string): void;
1946
- claim(id: string, occurrence: string, workerId: string): AutomationTick;
1947
- }
1948
- declare class AutomationMandateError extends Error {
1949
- readonly name = "AutomationMandateError";
1950
- }
1951
- //#endregion
1952
- //#region src/core/application/automation/scheduling/automation-scheduler.d.ts
1953
- declare const AUTOMATION_SUPPRESSION_PREFIX = "RIVUS_AUTOMATION_SUPPRESSED:";
1954
- interface ScheduledAutomationRunInput {
1955
- readonly occurrence: string;
1956
- readonly sessionKey: string;
1957
- readonly text: string;
1958
- readonly tickId: string;
1959
- }
1960
- interface ScheduledAutomationRunResult {
1961
- readonly body?: string;
1962
- readonly presentation?: AutomationPresentation;
1963
- readonly runId: string;
1964
- readonly suppressedReason?: string;
1965
- }
1966
- interface ScheduledAutomationDeliveryInput {
1967
- readonly body: string;
1968
- readonly idempotencyKey: string;
1969
- readonly presentation?: AutomationPresentation;
1970
- }
1971
- //#endregion
1972
- //#region src/core/domain/background-session/factories/create-background-session.d.ts
1973
- declare function createBackgroundSession$1(input: CreateBackgroundSessionInput): BackgroundSession;
1974
- //#endregion
1975
- //#region src/core/application/background-session/supervision/background-session-delivery-queue.d.ts
1976
- type BackgroundSessionDeliveryKindForSupervisor = "progress" | "final" | "stopped" | "failed" | "reconciliation";
1977
- type BackgroundSessionDeliverySink = (delivery: {
1978
- readonly deliveryId: string;
1979
- readonly kind: BackgroundSessionDeliveryKindForSupervisor;
1980
- readonly sessionId: string;
1981
- readonly text: string;
1982
- }) => Promise<{
1983
- readonly providerMessageId: string;
1984
- }>;
1985
- //#endregion
1986
- //#region src/core/application/background-session/supervision/background-session-supervisor.d.ts
1987
- interface BackgroundSessionLimits {
1988
- readonly intervalMs: number;
1989
- readonly leaseMs: number;
1990
- readonly leaseRenewalIntervalMs: number;
1991
- readonly maxConcurrentSessions: number;
1992
- readonly maxConsecutiveFailures: number;
1993
- readonly retryBackoffMs: number;
1994
- readonly sessionLifetimeMs: number;
1995
- }
1996
- interface BackgroundSessionStepResult {
1997
- readonly finalText: string;
1998
- readonly runId: string;
1999
- }
2000
- interface BackgroundSessionSupervisorOptions$1 {
2001
- readonly clock: {
2002
- now(): string;
2003
- };
2004
- readonly config: BackgroundSessionLimits;
2005
- readonly deliveries: BackgroundSessionDeliveryStore;
2006
- readonly deliver: BackgroundSessionDeliverySink;
2007
- readonly onError?: (error: unknown) => void;
2008
- readonly repository: BackgroundSessionRepository$1;
2009
- readonly runStep: (input: {
2010
- readonly session: BackgroundSession;
2011
- readonly signal: AbortSignal;
2012
- readonly wakeText: string;
2013
- }) => Promise<BackgroundSessionStepResult>;
2014
- readonly sleep: (ms: number) => Effect.Effect<void>;
2015
- }
2016
- interface BackgroundSessionSupervisorStatus {
2017
- readonly capacity: number;
2018
- readonly counters: {
2019
- readonly completed: number;
2020
- readonly deliveriesDelivered: number;
2021
- readonly failed: number;
2022
- readonly started: number;
2023
- readonly staleLeaseEventsDropped: number;
2024
- readonly stopped: number;
2025
- };
2026
- readonly inFlightSteps: number;
2027
- readonly oldestDueAt?: string;
2028
- readonly owner: string;
2029
- readonly phaseCounts: Readonly<Record<BackgroundSessionPhase, number>>;
2030
- readonly reconciliationCount: number;
2031
- readonly repositoryHealthy: boolean;
2032
- readonly running: boolean;
2033
- }
2034
- interface BackgroundSessionSupervisor {
2035
- recover(): Effect.Effect<void>;
2036
- start(): Effect.Effect<void>;
2037
- status(): BackgroundSessionSupervisorStatus;
2038
- stop(): Effect.Effect<void>;
2039
- tick(): Effect.Effect<void>;
2040
- }
2041
- //#endregion
2042
- //#region src/core/application/deployment/contracts/manifest.d.ts
2043
- interface RivusPluginDeclaration {
2044
- readonly id: string;
2045
- readonly module: string;
2046
- readonly required: boolean;
2047
- }
2048
- interface RivusDeploymentManifest {
2049
- readonly agents: ReadonlyArray<RivusAgentDeployment>;
2050
- readonly automations?: ReadonlyArray<RivusAutomationDeployment>;
2051
- readonly backgroundSessions?: RivusBackgroundSessionsDeployment;
2052
- readonly defaultAgentId: string;
2053
- readonly defaultEndpointId: string;
2054
- readonly endpoints: ReadonlyArray<RivusEndpointDeployment>;
2055
- readonly plugins: ReadonlyArray<RivusPluginDeclaration>;
2056
- readonly projectSpaces?: ReadonlyArray<RivusProjectSpaceDeployment>;
2057
- }
2058
- interface RivusBackgroundSessionsDeployment {
2059
- readonly enabled: boolean;
2060
- readonly leaseMs: number;
2061
- readonly leaseRenewalIntervalMs: number;
2062
- readonly maxConsecutiveFailures: number;
2063
- readonly maxConcurrentSessions: number;
2064
- readonly required: boolean;
2065
- readonly retryBackoffMs: number;
2066
- readonly sessionLifetimeMs: number;
2067
- readonly stepTimeoutMs: number;
2068
- }
2069
- type RivusAutomationDeliveryTargetType = "chat_id" | "open_id" | "user_id" | "union_id" | "email";
2070
- interface RivusAutomationDelivery {
2071
- readonly endpointId: string;
2072
- readonly targetRef: string;
2073
- readonly targetType: RivusAutomationDeliveryTargetType;
2074
- }
2075
- interface RivusAutomationDeployment {
2076
- readonly agentId: string;
2077
- readonly delivery: RivusAutomationDelivery;
2078
- readonly enabled: boolean;
2079
- readonly id: string;
2080
- readonly required: boolean;
2081
- readonly schedule: string;
2082
- readonly templateId: string;
2083
- readonly timeZone: string;
2084
- }
2085
- interface RivusEndpointDeployment {
2086
- readonly agentId: string;
2087
- readonly baseUrl: string;
2088
- readonly cardStreamLeaseMs: number;
2089
- readonly credentialRef: string;
2090
- readonly enabled: boolean;
2091
- readonly experimental?: RivusEndpointExperimentalFeatures;
2092
- readonly groupPolicy: "mention-only" | "ignore-unmentioned" | "default-responder";
2093
- readonly id: string;
2094
- readonly progressDisplay?: "hidden" | "collapsed" | "expanded";
2095
- readonly required: boolean;
2096
- readonly sessionNamespace: string;
2097
- readonly streamMinIntervalMs: number;
2098
- }
2099
- interface RivusEndpointExperimentalFeatures {
2100
- readonly cotMessages: boolean;
2101
- }
2102
- interface RivusProjectSpaceDeployment {
2103
- readonly id: string;
2104
- readonly root: string;
2105
- readonly workingDirectory: string;
2106
- readonly skills: {
2107
- readonly sources: ReadonlyArray<string>;
2108
- };
2109
- }
2110
- //#endregion
2111
- //#region src/core/application/deployment/contracts/deployment.d.ts
2112
- interface RivusPluginLoadStatus {
2113
- readonly error?: string;
2114
- readonly id: string;
2115
- readonly module: string;
2116
- readonly required: boolean;
2117
- readonly status: "loaded" | "failed";
2118
- readonly version?: string;
2119
- }
2120
- interface RivusAgentDeploymentStatus {
2121
- readonly agentId: string;
2122
- readonly definition?: ResolvedRivusAgentDefinition;
2123
- readonly pluginId: string;
2124
- readonly profileId: string;
2125
- readonly reason?: string;
2126
- readonly status: "enabled" | "disabled";
2127
- }
2128
- interface ResolvedRivusAutomationDefinition extends RivusAutomationDeployment {
2129
- readonly runtimeDefinition: ResolvedRivusAgentDefinition;
2130
- readonly template: RegisteredRivusAutomation;
2131
- }
2132
- interface ResolvedRivusProjectSpace {
2133
- readonly id: string;
2134
- readonly root: string;
2135
- readonly workingDirectory: string;
2136
- readonly skillPaths: ReadonlyArray<string>;
2137
- readonly revision: string;
2138
- }
2139
- interface LoadedRivusDeployment {
2140
- readonly agents: ReadonlyArray<RivusAgentDeploymentStatus>;
2141
- readonly automationDefinitions: ReadonlyArray<ResolvedRivusAutomationDefinition>;
2142
- readonly catalog: RivusPluginCatalog;
2143
- readonly definitions: ReadonlyArray<ResolvedRivusAgentDefinition>;
2144
- readonly manifest: RivusDeploymentManifest;
2145
- readonly plugins: ReadonlyArray<RivusPluginLoadStatus>;
2146
- }
2147
- interface RivusPluginModuleLoadRequest {
2148
- readonly deploymentRoot: string;
2149
- readonly module: string;
2150
- readonly pluginId: string;
2151
- }
2152
- interface RivusDeploymentBackgroundSessionCancellation {
2153
- readonly agentId: string;
2154
- readonly reason?: string;
2155
- readonly runId: string;
2156
- readonly sessionKey: string;
2157
- }
2158
- //#endregion
2159
- //#region src/adapters/deployment/process/process-deployment-adapters.d.ts
2160
- interface ProcessDeploymentRuntime extends ProcessAgentRuntime {}
2161
- interface CreateProcessDeploymentRuntimeInput extends AgentInstanceRecord {
2162
- readonly catalog: RivusPluginCatalog;
2163
- readonly definition: ResolvedRivusAgentDefinition;
2164
- readonly projectSpace?: ResolvedRivusProjectSpace;
2165
- }
2166
- interface ProcessDeploymentEndpoint {
2167
- running(): boolean;
2168
- start(): Promise<void> | void;
2169
- stop(): Promise<void> | void;
2170
- }
2171
- interface CreateProcessDeploymentEndpointInput {
2172
- readonly agentId: string;
2173
- readonly cancel: (input: AgentRuntimeCancellation$1) => Promise<boolean>;
2174
- readonly definition: RivusEndpointDeployment;
2175
- readonly endpointId: string;
2176
- readonly handle: (input: ProcessAgentRuntimeInput) => Promise<unknown>;
2177
- readonly instanceId: string;
2178
- readonly projectSpaceId?: string;
2179
- readonly steer?: (input: AgentRuntimeSteering$1) => Promise<boolean>;
2180
- }
2181
- interface ProcessDeploymentAutomation {
2182
- running(): boolean;
2183
- start(): Promise<void> | void;
2184
- stop(): Promise<void> | void;
2185
- }
2186
- interface CreateProcessDeploymentAutomationInput {
2187
- readonly automationId: string;
2188
- readonly definition: ResolvedRivusAutomationDefinition;
2189
- readonly deliveryEndpoint: RivusEndpointDeployment;
2190
- readonly instanceId: string;
2191
- readonly run: (input: ScheduledAutomationRunInput) => Promise<unknown>;
2192
- }
2193
- interface ProcessDeploymentBackgroundSession {
2194
- running(): boolean;
2195
- start(): Promise<void> | void;
2196
- status?(): BackgroundSessionSupervisorStatus;
2197
- stop(): Promise<void> | void;
2198
- }
2199
- interface CreateProcessDeploymentBackgroundSessionInput {
2200
- readonly agentIds: ReadonlyArray<string>;
2201
- readonly cancel: (input: RivusDeploymentBackgroundSessionCancellation) => Promise<boolean>;
2202
- readonly config: RivusBackgroundSessionsDeployment;
2203
- readonly run: (input: {
2204
- readonly agentId: string;
2205
- readonly invocation: AgentInvocationOrigin;
2206
- readonly onUpdate?: (update: AgentRunUpdate) => void | Promise<void>;
2207
- readonly sessionKey: string;
2208
- readonly text: string;
2209
- }) => Promise<unknown>;
2210
- }
2211
- //#endregion
2212
- //#region src/core/application/background-session/authority/background-session-authority.d.ts
2213
- declare const BACKGROUND_SESSION_TOOL_IDS: readonly ["background.start", "background.wait", "background.list", "background.status", "background.send", "background.stop"];
2214
- declare const BACKGROUND_SESSION_START_TOOL_ID = "background.start";
2215
- declare const BACKGROUND_SESSION_TOOL_PLUGIN_ID = "rivus-core";
2216
- declare const BACKGROUND_SESSION_TOOL_VERSION = "1.0.0";
2217
- interface BackgroundSessionToolContract {
2218
- readonly description: string;
2219
- readonly digest: string;
2220
- readonly id: string;
2221
- readonly idempotency: "none" | "supported" | "required";
2222
- readonly inputSchema: unknown;
2223
- readonly pluginId: string;
2224
- readonly risk: "observe" | "mutate" | "irreversible" | "host-control";
2225
- readonly version: string;
2226
- }
2227
- interface BackgroundSessionToolGrantSet {
2228
- readonly revision: string;
2229
- readonly toolIds: ReadonlyArray<string>;
2230
- }
2231
- interface BackgroundSessionAgentDefinition {
2232
- readonly agentId: string;
2233
- readonly endpointIds: ReadonlyArray<string>;
2234
- readonly memory: {
2235
- readonly scopes: ReadonlyArray<BackgroundSessionMemoryScope>;
2236
- };
2237
- readonly model: Readonly<Record<string, unknown>>;
2238
- readonly pluginId: string;
2239
- readonly profileId: string;
2240
- readonly profileRevision: string;
2241
- readonly projectSpaceId?: string;
2242
- readonly projectSpaceRevision?: string;
2243
- readonly skillGrantSet: {
2244
- readonly revision: string;
2245
- readonly skillIds: ReadonlyArray<string>;
2246
- };
2247
- readonly skills: ReadonlyArray<unknown>;
2248
- readonly systemPrompt: string;
2249
- readonly tools: ReadonlyArray<BackgroundSessionToolContract>;
2250
- readonly toolGrantSet: BackgroundSessionToolGrantSet;
2251
- }
2252
- type TransformedBackgroundSessionDefinition<T extends BackgroundSessionAgentDefinition> = Omit<T, "toolGrantSet" | "tools"> & {
2253
- readonly toolGrantSet: BackgroundSessionToolGrantSet;
2254
- readonly tools: ReadonlyArray<BackgroundSessionToolContract>;
2255
- };
2256
- declare function createBackgroundSessionToolContracts(): ReadonlyArray<BackgroundSessionToolContract>;
2257
- declare function backgroundSessionToolIds(): ReadonlyArray<string>;
2258
- declare function isBackgroundSessionToolId(toolId: string): boolean;
2259
- //#endregion
2260
- //#region src/core/application/deployment/lifecycle/deployment-lifecycle.d.ts
2261
- type RivusDeploymentComponentLifecycle = "disabled" | "stopped" | "starting" | "running" | "degraded" | "stopping" | "cleanup-required";
2262
- type RivusDeploymentControlLifecycle = "stopped" | "starting" | "running" | "degraded" | "stopping" | "cleanup-required";
2263
- declare class RivusDeploymentDaemonLifecycleError extends Error {
2264
- readonly name = "RivusDeploymentDaemonLifecycleError";
2265
- }
2266
- //#endregion
2267
- //#region src/core/application/deployment/lifecycle/deployment-control.d.ts
2268
- type RivusDeploymentDaemonLifecycle = RivusDeploymentControlLifecycle;
2269
- type RivusDeploymentEndpointLifecycle = RivusDeploymentComponentLifecycle;
2270
- type RivusDeploymentAutomationLifecycle = RivusDeploymentComponentLifecycle;
2271
- type RivusDeploymentBackgroundSessionLifecycle = RivusDeploymentComponentLifecycle;
2272
- interface RivusDeploymentEndpointStatus extends RivusDeploymentComponentStatus {
2273
- readonly agentId: string;
2274
- readonly endpointId: string;
2275
- }
2276
- interface RivusDeploymentAutomationStatus extends RivusDeploymentComponentStatus {
2277
- readonly agentId: string;
2278
- readonly automationId: string;
2279
- }
2280
- interface RivusDeploymentBackgroundSessionStatus extends RivusDeploymentComponentStatus {
2281
- readonly supervisor?: BackgroundSessionSupervisorStatus;
2282
- }
2283
- interface RivusDeploymentComponentStatus {
2284
- readonly enabled: boolean;
2285
- readonly error?: string;
2286
- readonly lifecycle: RivusDeploymentComponentLifecycle;
2287
- readonly required: boolean;
2288
- readonly running: boolean;
2289
- }
2290
- interface RivusDeploymentDaemonStatus {
2291
- readonly agents: LoadedRivusDeployment["agents"];
2292
- readonly automations: ReadonlyArray<RivusDeploymentAutomationStatus>;
2293
- readonly backgroundSessions?: RivusDeploymentBackgroundSessionStatus;
2294
- readonly defaultAgentId: string;
2295
- readonly defaultEndpointId: string;
2296
- readonly endpoints: ReadonlyArray<RivusDeploymentEndpointStatus>;
2297
- readonly lifecycle: RivusDeploymentDaemonLifecycle;
2298
- readonly plugins: LoadedRivusDeployment["plugins"];
2299
- readonly ready: boolean;
2300
- readonly running: boolean;
2301
- }
2302
- declare class RivusDeploymentReadinessError extends Error {
2303
- readonly endpointIds: ReadonlyArray<string>;
2304
- readonly name = "RivusDeploymentReadinessError";
2305
- constructor(endpointIds: ReadonlyArray<string>);
2306
- }
2307
- declare class RivusDeploymentAutomationReadinessError extends Error {
2308
- readonly automationIds: ReadonlyArray<string>;
2309
- readonly name = "RivusDeploymentAutomationReadinessError";
2310
- constructor(automationIds: ReadonlyArray<string>);
2311
- }
2312
- declare class RivusDeploymentBackgroundSessionReadinessError extends Error {
2313
- readonly name = "RivusDeploymentBackgroundSessionReadinessError";
2314
- constructor();
2315
- }
2316
- //#endregion
2317
- //#region src/bootstrap/deployment/rivus-deployment-cli-process.d.ts
2318
- interface RivusDeploymentBootstrapAdapters {
2319
- readonly initialInstanceRecords?: AgentInstanceRegistryOptions["initialRecords"];
2320
- readonly dispose?: () => Promise<void> | void;
2321
- readonly createAutomation?: (input: CreateProcessDeploymentAutomationInput) => ProcessDeploymentAutomation | Promise<ProcessDeploymentAutomation>;
2322
- readonly createBackgroundSession?: (input: CreateProcessDeploymentBackgroundSessionInput) => ProcessDeploymentBackgroundSession | Promise<ProcessDeploymentBackgroundSession>;
2323
- readonly createRecoveryControl?: () => Promise<RecoveryControl> | RecoveryControl;
2324
- readonly createRuntime: (input: CreateProcessDeploymentRuntimeInput) => ProcessDeploymentRuntime | Promise<ProcessDeploymentRuntime>;
2325
- readonly createEndpoint: (input: CreateProcessDeploymentEndpointInput) => ProcessDeploymentEndpoint | Promise<ProcessDeploymentEndpoint>;
2326
- readonly replayReceiveMessage?: (handleDefault: (input: ProcessAgentRuntimeInput) => Promise<unknown>, payload: FeishuReceiveMessagePayload, options?: FeishuReceiveMessageReplayOptions) => Effect.Effect<FeishuReceiveMessageReplayResult, unknown>;
2327
- }
2328
- interface RivusDeploymentBootstrapContext {
2329
- readonly argv: ReadonlyArray<string>;
2330
- readonly env: RivusDaemonEnv;
2331
- /** Explicit original configuration source, required for controlled export on disable. */
2332
- readonly envFilePath?: string;
2333
- /** Environment values before the explicit env file is merged. */
2334
- readonly environmentOverrides?: RivusDaemonEnv;
2335
- readonly manifestPath: string;
2336
- readonly pluginPackageManifestPath?: string;
2337
- }
2338
- type RivusDeploymentBootstrapFactory = (context: RivusDeploymentBootstrapContext) => Promise<RivusDeploymentBootstrapAdapters> | RivusDeploymentBootstrapAdapters;
2339
- interface RivusDeploymentCliProcess extends RivusDaemonProcess {
2340
- readonly defaultSessionKey: string;
2341
- openRecoveryControl(): Effect.Effect<RecoveryControl, unknown>;
2342
- promptText(command: PromptCommand): Effect.Effect<string, unknown>;
2343
- replayReceiveMessage?(payload: FeishuReceiveMessagePayload, options?: FeishuReceiveMessageReplayOptions): Effect.Effect<FeishuReceiveMessageReplayResult, unknown>;
2344
- status(): Effect.Effect<RivusDeploymentDaemonStatus>;
2345
- }
2346
- declare function createRivusDeploymentCliProcess(factory: RivusDeploymentBootstrapFactory, context: RivusDeploymentBootstrapContext): Promise<RivusDeploymentCliProcess>;
2347
- //#endregion
2348
- //#region src/bootstrap/daemon/rivus-daemon-cli.d.ts
2349
- interface RivusDaemonBootstrapContext {
2350
- readonly argv: ReadonlyArray<string>;
2351
- readonly config: RivusDaemonConfig;
2352
- readonly env: RivusDaemonEnv;
2353
- }
2354
- type RivusDaemonBootstrapFactory = (context: RivusDaemonBootstrapContext) => Promise<RivusDaemonProcess> | RivusDaemonProcess;
2355
- interface RivusDaemonBootstrapModule {
2356
- readonly createRivusDaemonProcess?: RivusDaemonBootstrapFactory;
2357
- readonly createRivusDeploymentAdapters?: RivusDeploymentBootstrapFactory;
2358
- readonly default?: RivusDaemonBootstrapFactory;
2359
- }
2360
- interface RivusDaemonCliWriter {
2361
- write(text: string): unknown;
2362
- }
2363
- interface RivusDaemonPromptRunner {
2364
- readonly defaultSessionKey?: string;
2365
- promptText(command: PromptCommand): Effect.Effect<string, unknown>;
2366
- }
2367
- interface RivusDaemonFeishuReplayRunner {
2368
- replayReceiveMessage(payload: FeishuReceiveMessagePayload, options?: FeishuReceiveMessageReplayOptions): Effect.Effect<FeishuReceiveMessageReplayResult, unknown>;
2369
- }
2370
- interface RivusDaemonRecoveryRunner {
2371
- openRecoveryControl(): Effect.Effect<RecoveryControl, unknown>;
2372
- }
2373
- interface RivusDaemonCliOptions {
2374
- readonly argv: ReadonlyArray<string>;
2375
- readonly env: RivusDaemonEnv;
2376
- readonly exitAfterSignal?: (exitCode: number) => void;
2377
- readonly loadBootstrap?: (specifier: string) => Promise<RivusDaemonBootstrapModule>;
2378
- readonly signalSource: RivusDaemonSignalSource;
2379
- readonly stderr: RivusDaemonCliWriter;
2380
- readonly stdout: RivusDaemonCliWriter;
2381
- readonly pluginPackageManifestPath?: string;
2382
- }
2383
- declare function runRivusDaemonCli(options: RivusDaemonCliOptions): Effect.Effect<number>;
2384
- //#endregion
2385
- //#region src/adapters/feishu/protocol/feishu-card-protocol.d.ts
2386
- /** Shared raw-card schema used by Feishu protocol adapters. */
2387
- interface FeishuRawCardJson {
2388
- readonly body: {
2389
- readonly direction?: "horizontal" | "vertical";
2390
- readonly elements: ReadonlyArray<unknown>;
2391
- readonly padding?: string;
2392
- readonly vertical_spacing?: string;
2393
- };
2394
- readonly config: {
2395
- readonly streaming_mode?: boolean;
2396
- readonly update_multi: true;
2397
- };
2398
- readonly header: {
2399
- readonly padding?: string;
2400
- readonly template: "blue" | "green" | "grey" | "orange" | "red";
2401
- readonly title: {
2402
- readonly content: string;
2403
- readonly tag: "plain_text";
2404
- };
2405
- };
2406
- readonly schema: "2.0";
2407
- }
2408
- //#endregion
2409
- //#region src/adapters/feishu/runtime/card-action-response.d.ts
2410
- interface FeishuCardActionCallbackResponse {
2411
- readonly card?: {
2412
- readonly data: FeishuRawCardJson;
2413
- readonly type: "raw";
2414
- };
2415
- readonly toast: FeishuCardActionToast;
2416
- }
2417
- interface FeishuCardActionToast {
2418
- readonly type: "success" | "info" | "warning" | "error";
2419
- readonly content: string;
2420
- readonly i18n?: {
2421
- readonly en_us?: string;
2422
- readonly zh_cn?: string;
2423
- };
2424
- }
2425
- declare function createFeishuCardActionCallbackResponse(result: FeishuAgentDaemonHandleResult): FeishuCardActionCallbackResponse;
2426
- declare function createFeishuCardActionErrorResponse(): FeishuCardActionCallbackResponse;
2427
- //#endregion
2428
- //#region src/adapters/feishu/runtime/event-handlers.d.ts
2429
- interface FeishuEventHandlerQueue {
2430
- accept(payload: FeishuReceiveMessagePayload): Effect.Effect<FeishuMessageAcceptResult, unknown>;
2431
- pending?(): number;
2432
- }
2433
- interface FeishuEventHandlerCardActions {
2434
- handleCardAction(payload: FeishuCardActionTriggerPayload): Effect.Effect<FeishuAgentDaemonHandleResult, unknown>;
2435
- }
2436
- interface FeishuEventHandlersOptions {
2437
- readonly cardActions?: FeishuEventHandlerCardActions;
2438
- readonly queue: FeishuEventHandlerQueue;
2439
- }
2440
- interface FeishuSdkReceiveMessagePayload {
2441
- readonly message: FeishuReceiveMessagePayload["event"]["message"];
2442
- readonly sender?: FeishuReceiveMessagePayload["event"]["sender"];
2443
- readonly tenant_key?: string;
2444
- }
2445
- type FeishuReceiveMessageHandlerPayload = FeishuReceiveMessagePayload | FeishuSdkReceiveMessagePayload;
2446
- interface FeishuEventHandlers {
2447
- readonly "card.action.trigger"?: (payload: FeishuCardActionTriggerPayload) => Promise<FeishuCardActionCallbackResponse>;
2448
- readonly "im.message.receive_v1": (payload: FeishuReceiveMessageHandlerPayload) => Promise<FeishuMessageAcceptResult>;
2449
- }
2450
- declare function createFeishuEventHandlers(options: FeishuEventHandlersOptions): FeishuEventHandlers;
2451
- //#endregion
2452
- //#region src/adapters/feishu/runtime/feishu-receive-runtime.d.ts
2453
- interface FeishuPeriodicFlushSupervisor {
2454
- withPeriodicFlush<A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, unknown, R>;
2455
- }
2456
- //#endregion
2457
- //#region src/bootstrap/feishu/agent-runtime.d.ts
2458
- interface FeishuAgentRuntimeOptions {
2459
- readonly acknowledgeSteering?: (messageId: string) => Effect.Effect<void, unknown>;
2460
- readonly agentId: string;
2461
- readonly botOpenId?: string;
2462
- readonly clock: AgentClock;
2463
- readonly eventSinks?: ReadonlyArray<AgentDomainEventSink>;
2464
- readonly finalizeRun?: (runId: AgentRunId$1) => Effect.Effect<void>;
2465
- readonly inboxRepository?: FeishuInboxRepository;
2466
- readonly initialEvents?: ReadonlyArray<AgentDomainEvent>;
2467
- readonly initialRunStates?: ReadonlyArray<AgentRunState>;
2468
- readonly loop: AgentLoop;
2469
- readonly prepareRun?: (run: FeishuAgentRunPreparation) => Effect.Effect<void, unknown>;
2470
- readonly promptContext?: FeishuPromptContextResolver;
2471
- readonly periodicFlush?: FeishuPeriodicFlushSupervisor;
2472
- readonly publish: (action: FeishuStreamAction) => Effect.Effect<void, unknown>;
2473
- readonly reply?: (messageId: string, text: string) => Effect.Effect<void, unknown>;
2474
- readonly runTimeoutMs?: number;
2475
- readonly runIds: RunIdGenerator;
2476
- readonly sessionStore?: FeishuSessionStore;
2477
- }
2478
- interface FeishuAgentRuntime {
2479
- readonly handlers: FeishuEventHandlers;
2480
- readonly harness: AgentHarness;
2481
- readonly queue: FeishuMessageQueue;
2482
- readonly worker: FeishuMessageWorker;
2483
- drainAvailable(): Effect.Effect<FeishuMessageWorkerDrainAvailableResult, unknown>;
2484
- drainOne(): Effect.Effect<FeishuMessageDrainResult, unknown>;
2485
- pending(): number;
2486
- receiveStatus(): FeishuReceiveRuntimeStatus;
2487
- replayReceiveMessage(payload: FeishuReceiveMessagePayload, options?: FeishuReceiveMessageReplayOptions): Effect.Effect<FeishuReceiveMessageReplayResult, unknown>;
2488
- }
2489
- declare function createFeishuAgentRuntime(options: FeishuAgentRuntimeOptions): FeishuAgentRuntime;
2490
- //#endregion
2491
- //#region src/core/application/agent-execution/execution/agent-event-sink.d.ts
2492
- declare function createAgentDomainEventSink(append: (event: AgentDomainEvent) => Effect.Effect<void, unknown>): AgentDomainEventSink;
2493
- //#endregion
2494
- //#region src/core/application/agent-execution/history/restore-agent-history.d.ts
2495
- interface AgentHistoryEventLog {
2496
- readAll(): Effect.Effect<ReadonlyArray<AgentDomainEvent>, unknown>;
2497
- }
2498
- declare function restoreAgentHistory(eventLog: AgentHistoryEventLog): Effect.Effect<AgentHistory, unknown>;
2499
- //#endregion
2500
- //#region src/adapters/outbound/persistence/agent-run/event-log/jsonl-agent-event-log.d.ts
2501
- type AgentEventLogOperation = "append" | "read";
2502
- declare class AgentEventLogStoreError {
2503
- readonly operation: AgentEventLogOperation;
2504
- readonly cause: unknown;
2505
- readonly _tag = "AgentEventLogStoreError";
2506
- constructor(operation: AgentEventLogOperation, cause: unknown);
2507
- }
2508
- interface AgentEventLog extends AgentDomainEventSink {
2509
- append(event: AgentDomainEvent): Effect.Effect<void, AgentEventLogStoreError>;
2510
- readAll(): Effect.Effect<ReadonlyArray<AgentDomainEvent>, AgentEventLogStoreError>;
2511
- readRun(runId: AgentRunId$1): Effect.Effect<ReadonlyArray<AgentDomainEvent>, AgentEventLogStoreError>;
2512
- }
2513
- interface JsonlAgentEventLogOptions {
2514
- readonly filePath: string;
2515
- }
2516
- declare function createJsonlAgentEventLog(options: JsonlAgentEventLogOptions): AgentEventLog;
2517
- //#endregion
2518
- //#region src/platform/daemon/status/daemon-status-reporter.d.ts
2519
- interface DaemonStatusSnapshot<History, RunState, CardStatus, ReceiveStatus> {
2520
- readonly agentId: string;
2521
- readonly cards?: CardStatus;
2522
- readonly harness: {
2523
- readonly activeRunId?: string;
2524
- readonly activeRunState?: RunState;
2525
- readonly activeSessionKey?: string;
2526
- readonly busy: boolean;
2527
- };
2528
- readonly history: History;
2529
- readonly process: {
2530
- readonly running: boolean;
2531
- };
2532
- readonly queue: {
2533
- readonly pending: number;
2534
- };
2535
- readonly receive?: ReceiveStatus;
2536
- readonly transport: {
2537
- readonly running: boolean;
2538
- };
2539
- readonly workerLoop: {
2540
- readonly running: boolean;
2541
- };
2542
- }
2543
- interface DaemonStatusReporter<History, RunState, CardStatus, ReceiveStatus> {
2544
- status(): Effect.Effect<DaemonStatusSnapshot<History, RunState, CardStatus, ReceiveStatus>, unknown>;
2545
- }
2546
- //#endregion
2547
- //#region src/adapters/feishu/runtime/websocket-daemon.d.ts
2548
- interface FeishuWebSocketClientStartOptions {
2549
- readonly eventDispatcher: unknown;
2550
- }
2551
- interface FeishuWebSocketClient {
2552
- connected?(): boolean;
2553
- start(options: FeishuWebSocketClientStartOptions): void | Promise<void>;
2554
- close?(): void | Promise<void>;
2555
- disconnect?(): void | Promise<void>;
2556
- stop?(): void | Promise<void>;
2557
- }
2558
- interface FeishuWebSocketEventDispatcher {
2559
- register(handlers: FeishuEventHandlers): unknown;
2560
- }
2561
- declare function createLazyFeishuWebSocketEventDispatcher(create: () => FeishuWebSocketEventDispatcher): FeishuWebSocketEventDispatcher;
2562
- interface FeishuWebSocketRuntime {
2563
- readonly handlers: FeishuEventHandlers;
2564
- drainAvailable?(): unknown;
2565
- }
2566
- type FeishuWebSocketDaemonOptions = {
2567
- readonly client: FeishuWebSocketClient;
2568
- readonly eventDispatcher: FeishuWebSocketEventDispatcher;
2569
- readonly handlers: FeishuEventHandlers;
2570
- readonly runtime?: never;
2571
- } | {
2572
- readonly client: FeishuWebSocketClient;
2573
- readonly eventDispatcher: FeishuWebSocketEventDispatcher;
2574
- readonly handlers?: never;
2575
- readonly runtime: FeishuWebSocketRuntime;
2576
- };
2577
- interface FeishuWebSocketDaemon {
2578
- running(): boolean;
2579
- start(): Promise<void>;
2580
- stop(): Promise<void>;
2581
- }
2582
- declare function createFeishuWebSocketDaemon(options: FeishuWebSocketDaemonOptions): FeishuWebSocketDaemon;
2583
- //#endregion
2584
- //#region src/adapters/feishu/card-presentation/delivery/feishu-cardkit-publisher.d.ts
2585
- interface FeishuCardTarget {
2586
- readonly cardId: string;
2587
- readonly elementId: string;
2588
- readonly progressElementId?: string;
2589
- }
2590
- interface FeishuCardKitTextUpdate {
2591
- readonly cardId: string;
2592
- readonly elementId: string;
2593
- readonly content: string;
2594
- readonly sequence: number;
2595
- }
2596
- interface FeishuCardKitPresentationUpdate {
2597
- readonly cardId: string;
2598
- readonly presentation?: RunPresentation;
2599
- readonly runId: AgentRunId$1;
2600
- readonly sequence: number;
2601
- readonly sessionKey: string;
2602
- readonly text?: string;
2603
- }
2604
- interface FeishuCardKitFinish {
2605
- readonly cardId: string;
2606
- readonly presentation?: RunPresentation;
2607
- readonly text: string;
2608
- readonly sequence: number;
2609
- }
2610
- interface FeishuCardKitFail {
2611
- readonly cardId: string;
2612
- readonly errorMessage: string;
2613
- readonly presentation?: RunPresentation;
2614
- readonly sequence: number;
2615
- }
2616
- interface FeishuCardKitCancel {
2617
- readonly cardId: string;
2618
- readonly presentation?: RunPresentation;
2619
- readonly reason?: string;
2620
- readonly sequence: number;
2621
- readonly text?: string;
2622
- }
2623
- interface FeishuCardKitClient {
2624
- cancel(request: FeishuCardKitCancel): Effect.Effect<void, unknown>;
2625
- updatePresentation(request: FeishuCardKitPresentationUpdate): Effect.Effect<void, unknown>;
2626
- updateText(request: FeishuCardKitTextUpdate): Effect.Effect<void, unknown>;
2627
- finish(request: FeishuCardKitFinish): Effect.Effect<void, unknown>;
2628
- fail(request: FeishuCardKitFail): Effect.Effect<void, unknown>;
2629
- }
2630
- interface FeishuCardKitPublisherOptions {
2631
- readonly client: FeishuCardKitClient;
2632
- readonly ledger?: FeishuCardDeliveryLedger;
2633
- readonly resolveTarget: (runId: AgentRunId$1) => Effect.Effect<FeishuCardTarget, unknown>;
2634
- }
2635
- interface FeishuCardKitPublisher {
2636
- publish(action: FeishuStreamAction): Effect.Effect<void, unknown>;
2637
- }
2638
- declare function createFeishuCardKitPublisher(options: FeishuCardKitPublisherOptions): FeishuCardKitPublisher;
2639
- //#endregion
2640
- //#region src/adapters/feishu/card-presentation/target/feishu-card-target-registry.d.ts
2641
- declare class FeishuCardTargetNotFound {
2642
- readonly runId: AgentRunId$1;
2643
- readonly _tag = "FeishuCardTargetNotFound";
2644
- constructor(runId: AgentRunId$1);
2645
- }
2646
- type FeishuCardTargetRegistryOperation = "load" | "save";
2647
- declare class FeishuCardTargetRegistryStoreError {
2648
- readonly operation: FeishuCardTargetRegistryOperation;
2649
- readonly cause: unknown;
2650
- readonly _tag = "FeishuCardTargetRegistryStoreError";
2651
- constructor(operation: FeishuCardTargetRegistryOperation, cause: unknown);
2652
- }
2653
- interface FeishuCardTargetRegistry extends FeishuCardPresentationStore {
2654
- resolveTarget(runId: AgentRunId$1): Effect.Effect<FeishuCardTarget, unknown>;
2655
- }
2656
- interface JsonFileFeishuCardTargetRegistryOptions {
2657
- readonly filePath: string;
2658
- }
2659
- declare function createInMemoryFeishuCardTargetRegistry(initial?: ReadonlyArray<CardPresentationChain>): FeishuCardTargetRegistry;
2660
- declare function createJsonFileFeishuCardTargetRegistry(options: JsonFileFeishuCardTargetRegistryOptions): FeishuCardTargetRegistry;
2661
- //#endregion
2662
- //#region src/adapters/feishu/card-presentation/rollover/feishu-card-rollover-supervisor.d.ts
2663
- interface FeishuCardRolloverSupervisorOptions {
2664
- readonly clock: AgentClock;
2665
- readonly intervalMs?: number;
2666
- readonly onError?: (error: unknown) => void | Promise<void>;
2667
- readonly rollover: Pick<FeishuCardRollover, "dueRunIds" | "handoff" | "recover">;
2668
- readonly sleep: (ms: number) => Effect.Effect<void, unknown>;
2669
- }
2670
- interface FeishuCardRolloverSupervisorTickResult {
2671
- readonly results: ReadonlyArray<FeishuCardRolloverHandoffResult>;
2672
- }
2673
- interface FeishuCardRolloverSupervisor {
2674
- recover(): Effect.Effect<void, unknown>;
2675
- running(): boolean;
2676
- start(): void;
2677
- stop(): Promise<void>;
2678
- tick(): Effect.Effect<FeishuCardRolloverSupervisorTickResult, unknown>;
2679
- }
2680
- declare function createFeishuCardRolloverSupervisor(options: FeishuCardRolloverSupervisorOptions): FeishuCardRolloverSupervisor;
2681
- //#endregion
2682
- //#region src/adapters/feishu/client/feishu-tenant-token-provider.d.ts
2683
- interface FeishuTenantAccessTokenRequest {
2684
- readonly method: "POST";
2685
- readonly url: string;
2686
- readonly headers: Readonly<Record<string, string>>;
2687
- readonly body: {
2688
- readonly app_id: string;
2689
- readonly app_secret: string;
2690
- };
2691
- }
2692
- interface FeishuTenantAccessTokenResponse {
2693
- readonly status: number;
2694
- readonly body: {
2695
- readonly code?: number;
2696
- readonly msg?: string;
2697
- readonly tenant_access_token?: string;
2698
- readonly expire?: number;
2699
- };
2700
- }
2701
- interface FeishuTenantAccessTokenProviderOptions {
2702
- readonly appId: string;
2703
- readonly appSecret: string;
2704
- readonly baseUrl?: string;
2705
- readonly refreshWindowMs?: number;
2706
- readonly now?: () => number;
2707
- readonly request: (request: FeishuTenantAccessTokenRequest) => Effect.Effect<FeishuTenantAccessTokenResponse, unknown>;
2708
- }
2709
- interface FeishuTenantAccessTokenProvider {
2710
- getTenantAccessToken(): Effect.Effect<string, unknown>;
2711
- }
2712
- declare class FeishuTenantAccessTokenError {
2713
- readonly status: number;
2714
- readonly code: number | undefined;
2715
- readonly message: string;
2716
- readonly _tag = "FeishuTenantAccessTokenError";
2717
- constructor(status: number, code: number | undefined, message: string);
2718
- }
2719
- declare function createFeishuTenantAccessTokenProvider(options: FeishuTenantAccessTokenProviderOptions): FeishuTenantAccessTokenProvider;
2720
- //#endregion
2721
- //#region src/adapters/feishu/client/feishu-openapi-client.d.ts
2722
- interface FeishuOpenApiRequest {
2723
- readonly method: "GET" | "PATCH" | "POST" | "PUT";
2724
- readonly url: string;
2725
- readonly headers: Readonly<Record<string, string>>;
2726
- readonly body?: unknown;
2727
- }
2728
- interface FeishuOpenApiResponse {
2729
- readonly status: number;
2730
- readonly body: {
2731
- readonly code?: number;
2732
- readonly msg?: string;
2733
- readonly data?: unknown;
2734
- };
2735
- }
2736
- interface FeishuOpenApiClient {
2737
- request(request: Omit<FeishuOpenApiRequest, "headers">, errorMessage?: string): Effect.Effect<FeishuOpenApiResponse, unknown>;
2738
- }
2739
- type ConfiguredFeishuOpenApiRequest = FeishuOpenApiRequest | FeishuTenantAccessTokenRequest;
2740
- type ConfiguredFeishuOpenApiResponse = FeishuOpenApiResponse | FeishuTenantAccessTokenResponse;
2741
- declare class FeishuOpenApiError extends Error {
2742
- readonly status: number;
2743
- readonly code: number | undefined;
2744
- readonly _tag = "FeishuOpenApiError";
2745
- readonly name = "FeishuOpenApiError";
2746
- constructor(status: number, code: number | undefined, message: string);
2747
- }
2748
- declare function createFeishuOpenApiClient(options: {
2749
- readonly getTenantAccessToken: () => Effect.Effect<string, unknown>;
2750
- readonly request: (request: FeishuOpenApiRequest) => Effect.Effect<FeishuOpenApiResponse, unknown>;
2751
- }): FeishuOpenApiClient;
2752
- declare function createConfiguredFeishuOpenApiClient(options: {
2753
- readonly config: RivusDaemonConfig;
2754
- readonly request: (request: ConfiguredFeishuOpenApiRequest) => Effect.Effect<ConfiguredFeishuOpenApiResponse, unknown>;
2755
- }): FeishuOpenApiClient;
2756
- //#endregion
2757
- //#region src/bootstrap/feishu/card-rollover-runtime.d.ts
2758
- interface ConfiguredFeishuCardRolloverRuntimeOptions {
2759
- readonly agentName?: string;
2760
- readonly cardTargets: FeishuCardTargetRegistry;
2761
- readonly cancelButton?: boolean;
2762
- readonly client: FeishuOpenApiClient;
2763
- readonly clock: AgentClock;
2764
- readonly config: RivusDaemonConfig;
2765
- readonly elementId?: string;
2766
- readonly initialContent?: string;
2767
- readonly flushIntervalMs?: number;
2768
- readonly ledger?: FeishuCardDeliveryLedger;
2769
- readonly observe?: (event: FeishuCardRolloverEvent) => void;
2770
- readonly onError?: (error: unknown) => void | Promise<void>;
2771
- readonly progressDisplay?: ConversationProgressDisplay;
2772
- readonly sleep: (ms: number) => Effect.Effect<void, unknown>;
2773
- readonly supervisorIntervalMs?: number;
2774
- readonly title?: string;
2775
- }
2776
- interface ConfiguredFeishuCardRolloverRuntime {
2777
- readonly rollover: FeishuCardRollover;
2778
- readonly supervisor: FeishuCardRolloverSupervisor;
2779
- readonly transport: RivusDaemonTransport;
2780
- prepareRun(run: FeishuAgentRunPreparation): Effect.Effect<void, unknown>;
2781
- }
2782
- declare function createConfiguredFeishuCardRolloverRuntime(options: ConfiguredFeishuCardRolloverRuntimeOptions): ConfiguredFeishuCardRolloverRuntime;
2783
- //#endregion
2784
- //#region src/bootstrap/feishu/rivus-daemon-bootstrap.d.ts
2785
- type ConfiguredRivusDaemonBootstrapRequest = ConfiguredFeishuOpenApiRequest;
2786
- type ConfiguredRivusDaemonBootstrapResponse = ConfiguredFeishuOpenApiResponse;
2787
- type ConfiguredRivusDaemonStatus = DaemonStatusSnapshot<AgentHistory, AgentRunState, FeishuCardRolloverStatus, FeishuReceiveRuntimeStatus>;
2788
- type ConfiguredRivusDaemonStatusReporter = DaemonStatusReporter<AgentHistory, AgentRunState, FeishuCardRolloverStatus, FeishuReceiveRuntimeStatus>;
2789
- interface ConfiguredRivusDaemonBootstrapOptions {
2790
- readonly botOpenId?: string;
2791
- readonly cardLedger?: FeishuCardDeliveryLedger;
2792
- readonly cardRolloverIntervalMs?: number;
2793
- readonly cardTargets: FeishuCardTargetRegistry;
2794
- readonly clock: AgentClock;
2795
- readonly config: RivusDaemonConfig;
2796
- readonly createStatusTransport?: (statusReporter: ConfiguredRivusDaemonStatusReporter) => RivusDaemonTransport;
2797
- readonly eventDispatcher: FeishuWebSocketEventDispatcher;
2798
- readonly eventLog: AgentEventLog;
2799
- readonly flushIntervalMs?: number;
2800
- readonly initialEvents?: ReadonlyArray<AgentDomainEvent>;
2801
- readonly initialRunStates?: ReadonlyArray<AgentRunState>;
2802
- readonly inboxRepository?: FeishuInboxRepository;
2803
- readonly loop: AgentLoop;
2804
- readonly observeCardRollover?: (event: FeishuCardRolloverEvent) => void;
2805
- readonly onWorkerError?: (error: unknown) => void | Promise<void>;
2806
- readonly request: (request: ConfiguredRivusDaemonBootstrapRequest) => Effect.Effect<ConfiguredRivusDaemonBootstrapResponse, unknown>;
2807
- readonly runIds: RunIdGenerator;
2808
- readonly runTimeoutMs?: number;
2809
- readonly sleep: (ms: number) => Effect.Effect<void, unknown>;
2810
- readonly websocketClient: FeishuWebSocketClient;
2811
- readonly workerIntervalMs?: number;
2812
- }
2813
- interface ConfiguredRivusDaemonBootstrap {
2814
- readonly cardRollover: ConfiguredFeishuCardRolloverRuntime;
2815
- readonly cardTargets: FeishuCardTargetRegistry;
2816
- readonly eventLog: AgentEventLog;
2817
- readonly process: RivusDaemonProcess;
2818
- readonly publisher: FeishuCardRollover;
2819
- readonly runtime: FeishuAgentRuntime;
2820
- readonly statusReporter: ConfiguredRivusDaemonStatusReporter;
2821
- readonly transport: RivusDaemonTransport;
2822
- readonly websocketTransport: FeishuWebSocketDaemon;
2823
- readonly workerLoop: FeishuWorkerLoop;
2824
- promptText(command: PromptCommand): Effect.Effect<string, unknown>;
2825
- restoreHistory(): Effect.Effect<AgentHistory, unknown>;
2826
- status(): Effect.Effect<ConfiguredRivusDaemonStatus, unknown>;
2827
- }
2828
- declare function restoreConfiguredRivusDaemonBootstrap(options: ConfiguredRivusDaemonBootstrapOptions): Effect.Effect<ConfiguredRivusDaemonBootstrap, unknown>;
2829
- declare function createConfiguredRivusDaemonBootstrap(options: ConfiguredRivusDaemonBootstrapOptions): ConfiguredRivusDaemonBootstrap;
2830
- //#endregion
2831
- //#region src/core/application/agent-execution/observation/agent-model-content-observer.d.ts
2832
- interface AgentModelInputObservation {
2833
- readonly input: unknown;
2834
- readonly modelCallId: string;
2835
- readonly runId: AgentRunId$1;
2836
- }
2837
- interface AgentModelOutputObservation {
2838
- readonly modelCallId: string;
2839
- readonly output: unknown;
2840
- readonly runId: AgentRunId$1;
2841
- }
2842
- interface AgentModelContentObserver {
2843
- observeInput(observation: AgentModelInputObservation): void;
2844
- observeOutput(observation: AgentModelOutputObservation): void;
2845
- }
2846
- //#endregion
2847
- //#region src/adapters/observability/agent/langfuse-agent-telemetry.d.ts
2848
- type LangfuseTelemetryEnv = Readonly<Record<string, string | undefined>>;
2849
- type LangfuseTelemetryContentMode = "metadata-only" | "redacted";
2850
- interface LangfuseTelemetryConfig {
2851
- readonly contentMode?: LangfuseTelemetryContentMode;
2852
- readonly endpoint: string;
2853
- readonly environment: string;
2854
- readonly publicKey: string;
2855
- readonly secretKey: string;
2856
- readonly serviceName: string;
2857
- }
2858
- interface LangfuseAgentTelemetry {
2859
- readonly modelContentObserver: AgentModelContentObserver;
2860
- readonly sink: AgentDomainEventSink;
2861
- forceFlush(): Promise<void>;
2862
- shutdown(): Promise<void>;
2863
- }
2864
- declare class LangfuseTelemetryConfigError extends Error {
2865
- constructor(message: string);
2866
- }
2867
- declare function resolveLangfuseTelemetryConfig(env: LangfuseTelemetryEnv): LangfuseTelemetryConfig | undefined;
2868
- declare function createLangfuseAgentTelemetry(config: LangfuseTelemetryConfig): LangfuseAgentTelemetry;
2869
- //#endregion
2870
- //#region src/adapters/observability/content/telemetry-content-redactor.d.ts
2871
- interface TelemetryContentRedactorOptions {
2872
- readonly maxArrayItems?: number;
2873
- readonly maxDepth?: number;
2874
- readonly maxObjectKeys?: number;
2875
- readonly maxSerializedLength?: number;
2876
- readonly maxStringLength?: number;
2877
- }
2878
- type TelemetryContentRedactor = (value: unknown) => string;
2879
- declare function createTelemetryContentRedactor(options?: TelemetryContentRedactorOptions): TelemetryContentRedactor;
2880
- //#endregion
2881
- //#region src/adapters/observability/agent/open-telemetry-agent-event-sink.d.ts
2882
- interface OpenTelemetryAgentEventSinkOptions {
2883
- readonly captureContent?: boolean;
2884
- readonly onProjectionError?: (error: unknown, event: AgentDomainEvent) => Promise<void> | void;
2885
- readonly redactContent?: TelemetryContentRedactor;
2886
- readonly tracer: Tracer;
2887
- }
2888
- interface OpenTelemetryAgentTelemetry {
2889
- readonly modelContentObserver: AgentModelContentObserver;
2890
- readonly sink: AgentDomainEventSink;
2891
- }
2892
- declare function createOpenTelemetryAgentEventSink(options: OpenTelemetryAgentEventSinkOptions): AgentDomainEventSink;
2893
- declare function createOpenTelemetryAgentTelemetry(options: OpenTelemetryAgentEventSinkOptions): OpenTelemetryAgentTelemetry;
2894
- //#endregion
2895
- //#region src/core/application/agent-execution/history/agent-run-state-projection.d.ts
2896
- declare const initialAgentRunState: AgentRunState;
2897
- declare function isTerminalAgentRunPhase(phase: AgentRunPhase): boolean;
2898
- declare function evolveAgentRun(state: AgentRunState, event: AgentDomainEvent): AgentRunState;
2899
- //#endregion
2900
- //#region src/core/application/deployment/model/model-change-contracts.d.ts
2901
- type ModelChangeOperation = "set" | "rollback";
2902
- interface ModelReference {
2903
- readonly model: string;
2904
- readonly provider: string;
2905
- }
2906
- interface ModelChangeSubmission {
2907
- readonly expectedRevision: number;
2908
- readonly operation: ModelChangeOperation;
2909
- readonly requestId: string;
2910
- readonly target?: ModelReference;
2911
- }
2912
- interface ModelChangeSource {
2913
- readonly kind: "automation" | "human";
2914
- readonly reference: string;
2915
- }
2916
- interface ModelChangePrincipal {
2917
- readonly homeId: string;
2918
- readonly ownerId: string;
2919
- readonly source: ModelChangeSource;
2920
- }
2921
- interface ModelChangeBudgetLimits {
2922
- readonly deadlineAt: string;
2923
- readonly identity: string;
2924
- readonly maxOutputTokens: number;
2925
- readonly maxPaidRequests: number;
2926
- readonly recoveryReserveOutputTokens: number;
2927
- readonly recoveryReservePaidRequests: number;
2928
- }
2929
- //#endregion
2930
- //#region src/adapters/pi/execution/pi-agent-loop.d.ts
2931
- type PiAgentSessionEvent = PiMessageStartEvent | PiMessageUpdateEvent | PiMessageEndEvent | PiToolExecutionStartEvent | PiToolExecutionUpdateEvent | PiToolExecutionEndEvent | {
2932
- readonly type: string;
2933
- readonly [key: string]: unknown;
2934
- };
2935
- interface PiMessageUpdateEvent {
2936
- readonly type: "message_update";
2937
- readonly message: unknown;
2938
- readonly assistantMessageEvent: {
2939
- readonly type: "text_delta";
2940
- readonly contentIndex: number;
2941
- readonly delta: string;
2942
- readonly partial: unknown;
2943
- } | {
2944
- readonly type: "thinking_delta";
2945
- readonly contentIndex: number;
2946
- readonly delta: string;
2947
- readonly partial: unknown;
2948
- } | {
2949
- readonly type: string;
2950
- readonly [key: string]: unknown;
2951
- };
2952
- }
2953
- interface PiMessageStartEvent {
2954
- readonly type: "message_start";
2955
- readonly message: unknown;
2956
- }
2957
- interface PiMessageEndEvent {
2958
- readonly type: "message_end";
2959
- readonly message: unknown;
2960
- }
2961
- interface PiToolExecutionStartEvent {
2962
- readonly type: "tool_execution_start";
2963
- readonly toolCallId: string;
2964
- readonly toolName: string;
2965
- readonly args?: unknown;
2966
- readonly input?: unknown;
2967
- }
2968
- interface PiToolExecutionUpdateEvent {
2969
- readonly type: "tool_execution_update";
2970
- readonly toolCallId: string;
2971
- readonly toolName: string;
2972
- readonly args?: unknown;
2973
- readonly input?: unknown;
2974
- readonly partialResult: unknown;
2975
- }
2976
- interface PiToolExecutionEndEvent {
2977
- readonly type: "tool_execution_end";
2978
- readonly toolCallId: string;
2979
- readonly toolName: string;
2980
- readonly result: unknown;
2981
- readonly isError: boolean;
2982
- }
2983
- /** Public session context shape needed by model management and history checks. */
2984
- interface PiSessionContext {
2985
- readonly messages: readonly unknown[];
2986
- }
2987
- /** Minimal session-manager capability exposed by the Pi adapter boundary. */
2988
- interface PiSessionManager {
2989
- readonly buildSessionContext: () => PiSessionContext;
2990
- }
2991
- interface PiAgentSession {
2992
- abort?: () => Promise<void> | void;
2993
- /** Native queue operations required when the loop opts into steering. */
2994
- steer?(text: string): Promise<void> | void;
2995
- readonly isStreaming?: boolean;
2996
- clearQueue?(): unknown;
2997
- setModel?(model: unknown): Promise<void> | void;
2998
- setThinkingLevel?(level: string): void;
2999
- waitForIdle?(): Promise<void>;
3000
- reload?(): Promise<void> | void;
3001
- readonly sessionManager?: PiSessionManager;
3002
- prompt(text: string): Promise<void>;
3003
- readonly state?: unknown;
3004
- subscribe(listener: (event: PiAgentSessionEvent) => void): () => void;
3005
- dispose?: () => Promise<void> | void;
3006
- }
3007
- interface PiCreateAgentSessionResult {
3008
- readonly session: PiAgentSession;
3009
- }
3010
- interface PiSdkAgentLoopOptions<TSessionOptions = unknown> {
3011
- readonly supportsSteering?: boolean;
3012
- readonly createAgentSession: (options: TSessionOptions | undefined) => Promise<PiCreateAgentSessionResult> | PiCreateAgentSessionResult;
3013
- readonly sessionOptions?: TSessionOptions;
3014
- }
3015
- //#endregion
3016
- //#region src/adapters/compatibility/agent-execution/pi/pi-agent-loop.d.ts
3017
- interface PiAgentSessionHandle {
3018
- readonly session: PiAgentSession;
3019
- readonly resolveToolName?: (toolName: string) => string;
3020
- readonly preparePrompt?: (input: AgentLoopInput) => Promise<string> | string;
3021
- readonly dispose?: () => Promise<void> | void;
3022
- readonly activate?: (input: AgentLoopInput) => Promise<void> | void;
3023
- readonly deactivate?: () => Promise<void> | void;
3024
- readonly refreshResources?: () => Promise<void> | void;
3025
- }
3026
- interface PiAgentLoopOptions {
3027
- readonly supportsSteering?: boolean;
3028
- readonly resolveSession: (input: AgentLoopInput) => Promise<PiAgentSessionHandle> | PiAgentSessionHandle;
3029
- readonly modelContentObserver?: AgentModelContentObserver;
3030
- readonly disposeSessionAfterRun?: boolean;
3031
- readonly runBoundary?: {
3032
- readonly acquireRun: (input?: {
3033
- readonly deadlineAt?: string;
3034
- readonly signal?: AbortSignal;
3035
- }) => Effect.Effect<{
3036
- readonly release: () => void;
3037
- }, unknown>;
3038
- };
3039
- }
3040
- declare function createPiAgentLoop(options: PiAgentLoopOptions): AgentLoop;
3041
- declare function createPiSdkAgentLoop<TSessionOptions = unknown>(options: PiSdkAgentLoopOptions<TSessionOptions>): AgentLoop;
3042
- //#endregion
3043
- //#region src/adapters/compatibility/agent-execution/pi/pi-session-registry.d.ts
3044
- interface PiSessionRegistryOptions {
3045
- readonly createSession: (input: AgentLoopInput) => Promise<PiAgentSessionHandle> | PiAgentSessionHandle;
3046
- }
3047
- interface PiSessionRegistry {
3048
- disposeAll(): Promise<void>;
3049
- dispose(sessionKey: SessionKey): Promise<void>;
3050
- list(): Promise<ReadonlyArray<PiAgentSessionHandle>>;
3051
- size(): number;
3052
- resolve(input: AgentLoopInput): Promise<PiAgentSessionHandle>;
3053
- }
3054
- declare function createPiSessionRegistry(options: PiSessionRegistryOptions): PiSessionRegistry;
3055
- //#endregion
3056
- //#region src/adapters/compatibility/run-presentation/run-presentation-projector.d.ts
3057
- interface RunPresentationProjector {
3058
- apply(event: AgentDomainEvent, canonicalText?: string): RunPresentation | undefined;
3059
- snapshot(runId: AgentRunId$1): RunPresentation | undefined;
3060
- }
3061
- declare function createRunPresentationProjector(): RunPresentationProjector;
3062
- //#endregion
3063
- //#region src/adapters/compatibility/card-presentation/feishu-card-presentation-store.d.ts
3064
- declare class FeishuCardPresentationNotFound {
3065
- readonly runId: string;
3066
- readonly _tag = "FeishuCardPresentationNotFound";
3067
- constructor(runId: string);
3068
- }
3069
- interface FeishuCardPresentationStoreOptions {
3070
- readonly initial?: ReadonlyArray<CardPresentationChain>;
3071
- readonly persist?: (chains: ReadonlyArray<CardPresentationChain>) => Promise<void>;
3072
- }
3073
- declare function createFeishuCardPresentationStore(options?: FeishuCardPresentationStoreOptions): FeishuCardPresentationStore;
3074
- //#endregion
3075
- //#region src/adapters/feishu/card-presentation/delivery/feishu-cardkit-openapi-client.d.ts
3076
- interface FeishuCardKitOpenApiClientOptions {
3077
- readonly agentName?: string;
3078
- readonly baseUrl?: string;
3079
- readonly cancelButton?: boolean;
3080
- readonly client: FeishuOpenApiClient;
3081
- readonly onStreamingClosed?: (cardId: string) => void;
3082
- readonly progressDisplay?: ConversationProgressDisplay;
3083
- }
3084
- declare function createFeishuCardKitOpenApiClient(options: FeishuCardKitOpenApiClientOptions): FeishuCardKitClient;
3085
- //#endregion
3086
- //#region src/adapters/feishu/intake/feishu-topic-context-resolver.d.ts
3087
- interface FeishuTopicContextResolverOptions {
3088
- readonly baseUrl?: string;
3089
- readonly client: FeishuOpenApiClient;
3090
- }
3091
- declare class InvalidFeishuTopicContext extends Error {
3092
- readonly name = "InvalidFeishuTopicContext";
3093
- }
3094
- declare function createFeishuTopicContextResolver(options: FeishuTopicContextResolverOptions): FeishuPromptContextResolver;
3095
- //#endregion
3096
- //#region src/adapters/feishu/delivery/cot/feishu-cot-publisher.d.ts
3097
- type FeishuCotRunPreparation = FeishuAgentRunPreparation;
3098
- interface FeishuCotPublisher {
3099
- fail(runId: string): Effect.Effect<void, unknown>;
3100
- prepare(run: FeishuCotRunPreparation): Effect.Effect<void, unknown>;
3101
- publish(update: AgentRunUpdate): Effect.Effect<void, unknown>;
3102
- }
3103
- interface FeishuCotPublisherOptions {
3104
- readonly baseUrl: string;
3105
- readonly client: FeishuOpenApiClient;
3106
- readonly minIntervalMs: number;
3107
- readonly now?: () => number;
3108
- }
3109
- declare class FeishuCotProtocolError extends Error {
3110
- readonly name = "FeishuCotProtocolError";
3111
- }
3112
- declare function createFeishuCotPublisher(options: FeishuCotPublisherOptions): FeishuCotPublisher;
3113
- //#endregion
3114
- //#region src/adapters/feishu/card-presentation/target/feishu-cardkit-target-preparation.d.ts
3115
- interface FeishuCardTargetCreateOptions {
3116
- readonly generation?: number;
3117
- readonly initialContent?: string;
3118
- readonly initialPresentation?: RunPresentation;
3119
- }
3120
- interface FeishuCardTargetCreator {
3121
- createTarget(run: FeishuAgentRunPreparation, options?: FeishuCardTargetCreateOptions): Effect.Effect<FeishuCardTarget, unknown>;
3122
- }
3123
- interface FeishuCardPresentationBinder {
3124
- bindRun(run: FeishuAgentRunPreparation, target: FeishuCardTarget): Effect.Effect<unknown, unknown>;
3125
- }
3126
- interface FeishuCardTargetPreparationOptions {
3127
- readonly createTarget: (run: FeishuAgentRunPreparation) => Effect.Effect<FeishuCardTarget, unknown>;
3128
- readonly presentations: FeishuCardPresentationBinder;
3129
- }
3130
- interface FeishuCardKitOpenApiTargetCreatorOptions {
3131
- readonly baseUrl?: string;
3132
- readonly cancelButton?: boolean;
3133
- readonly client: FeishuOpenApiClient;
3134
- readonly elementId: string;
3135
- readonly initialContent?: string;
3136
- readonly progressDisplay?: ConversationProgressDisplay;
3137
- readonly title?: string;
3138
- }
3139
- interface ConfiguredFeishuCardKitTargetCreatorOptions {
3140
- readonly cancelButton?: boolean;
3141
- readonly client: FeishuOpenApiClient;
3142
- readonly config: RivusDaemonConfig;
3143
- readonly elementId?: string;
3144
- readonly initialContent?: string;
3145
- readonly progressDisplay?: ConversationProgressDisplay;
3146
- readonly title?: string;
3147
- }
3148
- declare function createFeishuCardTargetPreparation(options: FeishuCardTargetPreparationOptions): (run: FeishuAgentRunPreparation) => Effect.Effect<void, unknown>;
3149
- declare function createConfiguredFeishuCardKitTargetCreator(options: ConfiguredFeishuCardKitTargetCreatorOptions): FeishuCardTargetCreator;
3150
- declare function createFeishuCardKitOpenApiTargetCreator(options: FeishuCardKitOpenApiTargetCreatorOptions): FeishuCardTargetCreator;
3151
- //#endregion
3152
- //#region src/adapters/feishu/card-presentation/streaming/feishu-rate-limited-publisher.d.ts
3153
- interface FeishuStreamActionPublisher {
3154
- publish(action: FeishuStreamAction): Effect.Effect<void, unknown>;
3155
- }
3156
- interface RateLimitedFeishuPublisherOptions {
3157
- readonly publisher: FeishuStreamActionPublisher;
3158
- readonly minIntervalMs: number;
3159
- readonly sleep: (ms: number) => Effect.Effect<void, unknown>;
3160
- }
3161
- declare function createRateLimitedFeishuPublisher(options: RateLimitedFeishuPublisherOptions): FeishuStreamActionPublisher;
3162
- //#endregion
3163
- //#region src/adapters/feishu/card-presentation/streaming/feishu-coalescing-publisher.d.ts
3164
- interface FeishuCoalescingPublisher extends FeishuStreamActionPublisher {
3165
- flush(runId?: AgentRunId$1): Effect.Effect<void, unknown>;
3166
- }
3167
- interface FeishuCoalescingPublisherOptions {
3168
- readonly publisher: FeishuStreamActionPublisher;
3169
- }
3170
- declare function createCoalescingFeishuPublisher(options: FeishuCoalescingPublisherOptions): FeishuCoalescingPublisher;
3171
- //#endregion
3172
- //#region src/adapters/feishu/card-presentation/delivery/feishu-configured-cardkit-publisher.d.ts
3173
- interface ConfiguredFeishuCardKitPublisherOptions {
3174
- readonly agentName?: string;
3175
- readonly cancelButton?: boolean;
3176
- readonly client: FeishuOpenApiClient;
3177
- readonly config: RivusDaemonConfig;
3178
- readonly ledger?: FeishuCardDeliveryLedger;
3179
- readonly onStreamingClosed?: (cardId: string) => void;
3180
- readonly progressDisplay?: ConversationProgressDisplay;
3181
- readonly resolveTarget: (runId: AgentRunId$1) => Effect.Effect<FeishuCardTarget, unknown>;
3182
- readonly sleep: (ms: number) => Effect.Effect<void, unknown>;
3183
- }
3184
- declare function createConfiguredFeishuCardKitPublisher(options: ConfiguredFeishuCardKitPublisherOptions): FeishuCoalescingPublisher;
3185
- //#endregion
3186
- //#region src/adapters/feishu/delivery/cot/feishu-periodic-flush.d.ts
3187
- interface FeishuPeriodicFlushOptions {
3188
- readonly flush: () => Effect.Effect<void, unknown>;
3189
- readonly intervalMs: number;
3190
- readonly sleep: (ms: number) => Effect.Effect<void, unknown>;
3191
- }
3192
- interface FeishuPeriodicFlush {
3193
- withPeriodicFlush<A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, unknown, R>;
3194
- }
3195
- declare function createFeishuPeriodicFlush(options: FeishuPeriodicFlushOptions): FeishuPeriodicFlush;
3196
- //#endregion
3197
- //#region src/testing/fakes.d.ts
3198
- declare function createFixedClock(now: Date): AgentClock;
3199
- declare function createTestClock(initial: Date): AgentClock & {
3200
- advance(ms: number): void;
3201
- };
3202
- declare function createSequenceRunIds(runIds: ReadonlyArray<AgentRunId$1>): RunIdGenerator;
3203
- //#endregion
3204
- //#region src/adapters/compatibility/agent-catalog/rivus-agent-catalog.d.ts
3205
- declare function createRivusPluginCatalog(): RivusPluginCatalog;
3206
- declare function resolveRivusAgentDefinition(catalog: RivusPluginCatalog, deployment: RivusAgentDeployment, options?: {
3207
- readonly backgroundSessions?: boolean;
3208
- }): ResolvedRivusAgentDefinition;
3209
- //#endregion
3210
- //#region src/core/application/agent-execution/contracts/workspace-instructions.d.ts
3211
- interface WorkspaceRootHandle {
3212
- readonly id: string;
3213
- }
3214
- interface WorkspaceInstructionSource {
3215
- readonly relativePath: string;
3216
- readonly digest: string;
3217
- readonly bytes: number;
3218
- readonly content: string;
3219
- }
3220
- type WorkspaceInstructionsDiagnosticCode = "workspace-instructions-refresh-required" | "workspace-instructions-source-omitted";
3221
- interface WorkspaceInstructionsDiagnostic {
3222
- readonly code: WorkspaceInstructionsDiagnosticCode;
3223
- readonly relativePath?: string;
3224
- readonly reason: string;
3225
- }
3226
- interface WorkspaceInstructionsRequest {
3227
- readonly workspaceRoot: WorkspaceRootHandle;
3228
- readonly workingDirectory: string;
3229
- readonly targetPath?: string;
3230
- readonly maxBytes: number;
3231
- readonly operation?: "read" | "mutate";
3232
- readonly presentedDigests?: ReadonlyArray<string>;
3233
- }
3234
- interface WorkspaceInstructionsView {
3235
- readonly sources: ReadonlyArray<WorkspaceInstructionSource>;
3236
- readonly content: string;
3237
- readonly digest: string;
3238
- readonly truncated: boolean;
3239
- readonly refreshRequired: boolean;
3240
- readonly diagnostics: ReadonlyArray<WorkspaceInstructionsDiagnostic>;
3241
- }
3242
- //#endregion
3243
- //#region src/core/application/agent-execution/context/workspace-instructions-resolver.d.ts
3244
- declare class InvalidWorkspaceRoot extends Error {
3245
- readonly name = "InvalidWorkspaceRoot";
3246
- }
3247
- declare class WorkspaceInstructionsSourceError extends Error {
3248
- readonly relativePath: string;
3249
- readonly reason: string;
3250
- readonly name = "WorkspaceInstructionsSourceError";
3251
- constructor(relativePath: string, reason: string);
3252
- }
3253
- //#endregion
3254
- //#region src/adapters/agent/workspace/node-workspace-root-registry.d.ts
3255
- declare function createWorkspaceRootHandle(rootPath: string): Promise<WorkspaceRootHandle>;
3256
- //#endregion
3257
- //#region src/adapters/compatibility/project-space/workspace-instructions.d.ts
3258
- interface WorkspaceInstructionsProvider {
3259
- resolve(request: WorkspaceInstructionsRequest): Promise<WorkspaceInstructionsView>;
3260
- }
3261
- declare function createAgentsMdInstructionsProvider(): WorkspaceInstructionsProvider;
3262
- //#endregion
3263
- //#region src/core/application/tool-execution/brokerage/tool-input-digest.d.ts
3264
- declare class InvalidStableJson extends Error {
3265
- readonly name: string;
3266
- }
3267
- declare class InvalidToolInput extends InvalidStableJson {
3268
- readonly name = "InvalidToolInput";
3269
- }
3270
- declare function normalizeStableJson(value: unknown): unknown;
3271
- //#endregion
3272
- //#region src/adapters/compatibility/tool-execution/public-contract.d.ts
3273
- interface InvocationAuthorityRef extends InvocationAuthorityRef$1 {}
3274
- interface InvocationAuthority extends Omit<InvocationAuthority$1, "memory" | "toolGrantSet"> {
3275
- readonly memory?: RivusMemoryAuthority;
3276
- readonly toolGrantSet: RivusToolGrantSet;
3277
- }
3278
- declare function createInvocationAuthority(authority: InvocationAuthority): InvocationAuthorityRef;
3279
- declare function createToolInputDigest(input: unknown): string;
3280
- declare function requiresToolApproval(risk: RivusToolRisk): boolean;
3281
- //#endregion
3282
- //#region src/core/application/tool-execution/brokerage/tool-broker.d.ts
3283
- declare class ToolInvocationDenied extends Error {
3284
- readonly name = "ToolInvocationDenied";
3285
- }
3286
- //#endregion
3287
- //#region src/adapters/compatibility/tool-execution/tool-broker.d.ts
3288
- interface AuthorizationPolicyState extends AuthorizationPolicyState$1 {}
3289
- interface ToolApprovalRequest extends ToolApprovalRequest$1 {
3290
- readonly risk: RivusToolRisk;
3291
- }
3292
- interface AuthorizationPolicyProvider {
3293
- current(): Promise<AuthorizationPolicyState>;
3294
- }
3295
- interface ToolApprovalService {
3296
- consume(request: ToolApprovalRequest): Promise<boolean>;
3297
- }
3298
- interface ToolBrokerOptions {
3299
- readonly approvals: ToolApprovalService;
3300
- readonly catalog: RivusPluginCatalog;
3301
- readonly hostTools?: ReadonlyArray<RivusHostToolDescriptor>;
3302
- readonly policy: AuthorizationPolicyProvider;
3303
- readonly operations?: ToolOperationLedger;
3304
- }
3305
- interface ToolExecutionRequest extends ToolExecutionRequest$1 {
3306
- readonly authority: InvocationAuthorityRef;
3307
- }
3308
- interface ToolBroker {
3309
- execute(request: ToolExecutionRequest): Promise<unknown>;
3310
- }
3311
- declare function createToolBroker(options: ToolBrokerOptions): ToolBroker;
3312
- //#endregion
3313
- //#region src/adapters/compatibility/tool-execution/jsonl-tool-operation-ledger.d.ts
3314
- declare function openJsonlToolOperationLedger(options: {
3315
- readonly filePath: string;
3316
- }): Promise<ToolOperationLedger>;
3317
- //#endregion
3318
- //#region src/adapters/compatibility/recovery/jsonl-recovery-control.d.ts
3319
- interface JsonlRecoveryControlOptions {
3320
- readonly clock?: {
3321
- readonly now: () => string;
3322
- };
3323
- readonly endpointsDirectory: string;
3324
- readonly instancesDirectory: string;
3325
- }
3326
- declare function openJsonlRecoveryControl(options: JsonlRecoveryControlOptions): Promise<RecoveryControl>;
3327
- //#endregion
3328
- //#region src/adapters/compatibility/agent-host/runtime/agent-harness-pooled-runtime.d.ts
3329
- declare function createAgentHarnessPooledRuntime(harness: AgentHarness): PooledAgentRuntime;
3330
- //#endregion
3331
- //#region src/bootstrap/feishu/deployment-endpoint.d.ts
3332
- interface FeishuDeploymentEndpointOptions extends Pick<CreateProcessDeploymentEndpointInput, "agentId" | "cancel" | "handle" | "steer"> {
3333
- readonly acknowledgeSteering?: (messageId: string) => Effect.Effect<void, unknown>;
3334
- readonly botOpenId: string;
3335
- readonly cardRollover?: RivusDaemonTransport;
3336
- readonly endpointId?: string;
3337
- readonly finalizeRun?: (runId: string) => Effect.Effect<void>;
3338
- readonly eventDispatcher: FeishuWebSocketEventDispatcher;
3339
- readonly groupPolicy: FeishuEndpointGroupPolicy;
3340
- readonly initialEvents?: ReadonlyArray<AgentDomainEvent>;
3341
- readonly interactions?: FeishuHumanInteractionActions;
3342
- readonly inboxRepository?: FeishuInboxRepository;
3343
- readonly maxPendingMessages?: number;
3344
- readonly memoryTenantId?: string;
3345
- readonly projectSpaceId?: string;
3346
- readonly onWorkerError?: (error: unknown) => void | Promise<void>;
3347
- readonly onCapacityExceeded?: (payload: FeishuReceiveMessagePayload) => Effect.Effect<void, unknown>;
3348
- readonly prepareRun?: (run: FeishuAgentRunPreparation) => Effect.Effect<void, unknown>;
3349
- readonly promptContext: FeishuPromptContextResolver;
3350
- readonly publish: (action: FeishuStreamAction) => Effect.Effect<void, unknown>;
3351
- readonly publishRunUpdate?: AgentRunUpdateHandler;
3352
- readonly reply?: (messageId: string, text: string) => Effect.Effect<void, unknown>;
3353
- readonly sessionStore?: FeishuSessionStore;
3354
- readonly sessionNamespace: string;
3355
- readonly shutdownTimeoutMs?: number;
3356
- readonly sleep: (ms: number) => Effect.Effect<void, unknown>;
3357
- readonly websocketClient: FeishuWebSocketClient;
3358
- readonly workerIntervalMs?: number;
3359
- readonly workerConcurrency?: number;
3360
- }
3361
- declare function createFeishuDeploymentEndpoint(options: FeishuDeploymentEndpointOptions): ProcessDeploymentEndpoint;
3362
- //#endregion
3363
- //#region src/adapters/feishu/run-presentation/feishu-presentation-preparation.d.ts
3364
- interface FeishuPresentationPreparationOptions {
3365
- readonly cotPublisher?: Pick<FeishuCotPublisher, "fail" | "prepare">;
3366
- readonly prepareCardTarget: (run: FeishuAgentRunPreparation) => Effect.Effect<void, unknown>;
3367
- readonly reportCotError: (operation: "abort" | "create", error: unknown) => Effect.Effect<void>;
3368
- }
3369
- declare function createFeishuPresentationPreparation(options: FeishuPresentationPreparationOptions): (run: FeishuAgentRunPreparation) => Effect.Effect<void, unknown>;
3370
- //#endregion
3371
- //#region src/adapters/compatibility/agent-host/rivus-agent-host.d.ts
3372
- interface RivusEndpointDefinition {
3373
- readonly id: string;
3374
- readonly agentId: string;
3375
- }
3376
- interface RivusAgentHostOptions {
3377
- readonly automations?: ReadonlyArray<RivusAutomationDefinition>;
3378
- readonly backgroundSessions?: ReadonlyArray<RivusBackgroundSessionDefinition>;
3379
- readonly definitions: ReadonlyArray<ResolvedRivusAgentDefinition>;
3380
- readonly endpoints: ReadonlyArray<RivusEndpointDefinition>;
3381
- readonly runtimePool: AgentRuntimePool;
3382
- }
3383
- interface RivusAutomationDefinition {
3384
- readonly definition: ResolvedRivusAgentDefinition;
3385
- readonly id: string;
3386
- }
3387
- interface RivusBackgroundSessionDefinition {
3388
- readonly agentId: string;
3389
- readonly definition: ResolvedRivusAgentDefinition;
3390
- }
3391
- interface RivusEndpointInput$1 extends AgentRuntimeInput {}
3392
- interface RivusAgentHost {
3393
- cancelBackgroundSession(agentId: string, input: AgentRuntimeCancellation): Promise<boolean>;
3394
- cancelEndpoint(endpointId: string, input: AgentRuntimeCancellation): Promise<boolean>;
3395
- steerEndpoint(endpointId: string, input: AgentRuntimeSteering): Promise<boolean>;
3396
- handleAutomation(automationId: string, input: AgentRuntimeInput): Promise<unknown>;
3397
- handleBackgroundSession(agentId: string, input: AgentRuntimeInput): Promise<unknown>;
3398
- handleEndpoint(endpointId: string, input: RivusEndpointInput$1): Promise<unknown>;
3399
- resolveAutomation(automationId: string): AgentInstanceRecord;
3400
- resolveBackgroundSession(agentId: string): AgentInstanceRecord;
3401
- resolveEndpoint(endpointId: string): AgentInstanceRecord;
3402
- }
3403
- declare class InvalidRivusEndpointBinding extends Error {
3404
- readonly name = "InvalidRivusEndpointBinding";
3405
- }
3406
- declare function createRivusAgentHost(options: RivusAgentHostOptions): RivusAgentHost;
3407
- //#endregion
3408
- //#region src/core/application/memory/commands/agent-memory-service.d.ts
3409
- declare class AgentMemoryError extends Error {
3410
- readonly name = "AgentMemoryError";
3411
- }
3412
- //#endregion
3413
- //#region src/adapters/agent/memory/agent-memory-access.d.ts
3414
- declare const MEMORY_SCOPES: readonly ["conversation", "agent-private", "project", "shared-user-profile"];
3415
- type MemoryScope = (typeof MEMORY_SCOPES)[number];
3416
- type MemoryInvocationAudience = "group" | "private";
3417
- interface MemoryBinding {
3418
- readonly agentId: string;
3419
- readonly conversationId?: string;
3420
- readonly projectId?: string;
3421
- readonly scope: MemoryScope;
3422
- readonly subjectId: string;
3423
- readonly tenantId: string;
3424
- }
3425
- interface AgentMemoryIdentity {
3426
- readonly audience: MemoryInvocationAudience;
3427
- readonly conversationId?: string;
3428
- readonly projectId?: string;
3429
- readonly subjectId: string;
3430
- readonly tenantId: string;
3431
- }
3432
- interface AgentMemoryAuthority extends AgentMemoryIdentity {
3433
- readonly scopes: ReadonlyArray<MemoryScope>;
3434
- }
3435
- type MemoryState = "proposed" | "confirmed" | "superseded" | "tombstoned";
3436
- interface MemoryRecord {
3437
- readonly content: string;
3438
- readonly conversationSafe: boolean;
3439
- readonly id: string;
3440
- readonly revision: number;
3441
- readonly scope: MemoryScope;
3442
- readonly state: MemoryState;
3443
- readonly tombstoneReason?: string;
3444
- }
3445
- interface AgentMemorySnapshot {
3446
- readonly binding: MemoryBinding;
3447
- readonly record: MemoryRecord;
3448
- }
3449
- interface MemorySearchQuery {
3450
- readonly query: string;
3451
- }
3452
- /** Promise-based Memory access required at the host-tool adapter boundary. */
3453
- interface AgentMemoryHandle {
3454
- readonly namespace: string;
3455
- readonly scope: MemoryScope;
3456
- confirm(input: {
3457
- readonly id: string;
3458
- readonly expectedRevision: number;
3459
- readonly conversationSafe?: boolean;
3460
- }): Promise<MemoryRecord>;
3461
- forgetRequest(input: {
3462
- readonly expectedRevision: number;
3463
- readonly id: string;
3464
- readonly reason?: string;
3465
- }): Promise<MemoryRecord>;
3466
- inspect(id: string): Promise<MemoryRecord | undefined>;
3467
- propose(input: {
3468
- readonly content: string;
3469
- }): Promise<MemoryRecord>;
3470
- read(id: string): Promise<MemoryRecord | undefined>;
3471
- search(query: MemorySearchQuery): Promise<ReadonlyArray<MemoryRecord>>;
3472
- }
3473
- /** Consumer-owned port implemented by Memory compatibility adapters. */
3474
- interface AgentMemoryService {
3475
- bind(binding: MemoryBinding): AgentMemoryHandle;
3476
- }
3477
- //#endregion
3478
- //#region src/adapters/compatibility/memory/service/agent-memory-service.d.ts
3479
- interface AgentMemoryServiceOptions {
3480
- readonly ids?: {
3481
- readonly next: () => string;
3482
- };
3483
- readonly initial?: ReadonlyArray<AgentMemorySnapshot>;
3484
- readonly persist?: (snapshot: AgentMemorySnapshot) => Promise<void>;
3485
- }
3486
- declare function createAgentMemoryService(options?: AgentMemoryServiceOptions): AgentMemoryService;
3487
- //#endregion
3488
- //#region src/adapters/compatibility/background-session/transitions.d.ts
3489
- type BackgroundSessionState = BackgroundSessionSnapshot;
3490
- declare function isBackgroundSessionTerminalPhase(phase: BackgroundSessionPhase): boolean;
3491
- declare class BackgroundSessionTransitionDenied extends Error {
3492
- readonly sessionId: BackgroundSessionId;
3493
- readonly name = "BackgroundSessionTransitionDenied";
3494
- constructor(sessionId: BackgroundSessionId, message: string);
3495
- }
3496
- declare function createBackgroundSession(input: Parameters<typeof createBackgroundSession$1>[0]): BackgroundSessionState;
3497
- declare function claimBackgroundSession(state: BackgroundSessionState, input: ClaimBackgroundSessionInput): BackgroundSessionState;
3498
- declare function renewBackgroundSessionLease(state: BackgroundSessionState, lease: BackgroundSessionLease): BackgroundSessionState;
3499
- declare function releaseBackgroundSessionLease(state: BackgroundSessionState): BackgroundSessionState;
3500
- declare function suspendBackgroundSession(state: BackgroundSessionState, input: SuspendBackgroundSessionInput): BackgroundSessionState;
3501
- declare function completeBackgroundSessionStep(state: BackgroundSessionState, input: {
3502
- readonly text: string;
3503
- readonly stepRunId: string;
3504
- readonly now: string;
3505
- }): BackgroundSessionState;
3506
- declare function failBackgroundSessionStep(state: BackgroundSessionState, input: {
3507
- readonly errorMessage: string;
3508
- readonly now: string;
3509
- readonly retryable: boolean;
3510
- readonly wakeAt?: string;
3511
- }): BackgroundSessionState;
3512
- declare function requestBackgroundSessionStop(state: BackgroundSessionState, input: {
3513
- readonly reason: string;
3514
- readonly now: string;
3515
- }): BackgroundSessionState;
3516
- declare function completeBackgroundSessionStop(state: BackgroundSessionState, input: {
3517
- readonly now: string;
3518
- }): BackgroundSessionState;
3519
- declare function parkBackgroundSessionForReconciliation(state: BackgroundSessionState, input: {
3520
- readonly reason: string;
3521
- readonly now: string;
3522
- }): BackgroundSessionState;
3523
- declare function resolveBackgroundSessionReconciliation(state: BackgroundSessionState, input: {
3524
- readonly outcome: "continue" | "stop";
3525
- readonly now: string;
3526
- }): BackgroundSessionState;
3527
- declare function appendBackgroundSessionInput(state: BackgroundSessionState, input: {
3528
- readonly message: string;
3529
- readonly now: string;
3530
- }): BackgroundSessionState;
3531
- declare function requeueInterruptedBackgroundSessionStep(state: BackgroundSessionState, input: {
3532
- readonly wakeText: string;
3533
- readonly now: string;
3534
- }): BackgroundSessionState;
3535
- declare function isBackgroundSessionDue(state: BackgroundSessionState, now: string): boolean;
3536
- declare function isBackgroundSessionLeaseExpired(state: BackgroundSessionState, now: string): boolean;
3537
- //#endregion
3538
- //#region src/adapters/compatibility/background-session/repository.d.ts
3539
- interface BackgroundSessionRepository {
3540
- create(state: BackgroundSessionState): Promise<BackgroundSessionState>;
3541
- get(sessionId: string): Promise<BackgroundSessionState | undefined>;
3542
- list(options?: {
3543
- readonly phase?: BackgroundSessionPhase;
3544
- readonly limit?: number;
3545
- }): Promise<ReadonlyArray<BackgroundSessionState>>;
3546
- update(input: {
3547
- readonly sessionId: string;
3548
- readonly expectedRevision: number;
3549
- readonly expectedLease?: BackgroundSessionLeasePrecondition | BackgroundSessionLeaseRequirement | BackgroundSessionLeaseStaleOrAbsent;
3550
- readonly now?: string;
3551
- readonly build: (state: BackgroundSessionState) => BackgroundSessionState;
3552
- }): Promise<BackgroundSessionState | undefined>;
3553
- }
3554
- //#endregion
3555
- //#region src/adapters/compatibility/background-session/service.d.ts
3556
- interface BackgroundSessionServiceOptions {
3557
- readonly clock: {
3558
- now(): string;
3559
- };
3560
- readonly deliveries: BackgroundSessionDeliveryStore;
3561
- readonly repository: BackgroundSessionRepository;
3562
- }
3563
- declare function createBackgroundSessionService(options: BackgroundSessionServiceOptions): BackgroundSessionService;
3564
- //#endregion
3565
- //#region src/adapters/outbound/persistence/background-session/session/jsonl-background-session-repository.d.ts
3566
- declare const BACKGROUND_SESSION_JSONL_VERSION = 1;
3567
- interface OpenJsonlBackgroundSessionRepositoryOptions {
3568
- readonly filePath: string;
3569
- readonly compactThreshold?: number;
3570
- }
3571
- declare function isBackgroundSessionState(value: unknown): value is BackgroundSessionSnapshot;
3572
- //#endregion
3573
- //#region src/adapters/outbound/persistence/background-session/delivery/in-memory-background-session-delivery-store.d.ts
3574
- interface CreateBackgroundSessionDeliveryStoreOptions {
3575
- readonly initial?: ReadonlyArray<BackgroundSessionDeliveryRecord>;
3576
- readonly persist?: (record: BackgroundSessionDeliveryRecord) => Promise<void>;
3577
- }
3578
- declare function createBackgroundSessionDeliveryStore(options?: CreateBackgroundSessionDeliveryStoreOptions): BackgroundSessionDeliveryStore;
3579
- //#endregion
3580
- //#region src/adapters/outbound/persistence/background-session/delivery/jsonl-background-session-delivery-store.d.ts
3581
- declare const BACKGROUND_SESSION_DELIVERY_JSONL_VERSION = 1;
3582
- interface OpenJsonlBackgroundSessionDeliveryStoreOptions {
3583
- readonly filePath: string;
3584
- readonly compactThreshold?: number;
3585
- }
3586
- declare function openJsonlBackgroundSessionDeliveryStore(options: OpenJsonlBackgroundSessionDeliveryStoreOptions): Promise<BackgroundSessionDeliveryStore>;
3587
- //#endregion
3588
- //#region src/adapters/compatibility/background-session/persistence.d.ts
3589
- interface CreateBackgroundSessionRepositoryOptions {
3590
- readonly initial?: ReadonlyArray<BackgroundSessionState>;
3591
- readonly persist?: (state: BackgroundSessionState) => Promise<void>;
3592
- }
3593
- declare function createBackgroundSessionRepository(options?: CreateBackgroundSessionRepositoryOptions): BackgroundSessionRepository;
3594
- declare function openJsonlBackgroundSessionRepository(options: OpenJsonlBackgroundSessionRepositoryOptions): Promise<BackgroundSessionRepository>;
3595
- //#endregion
3596
- //#region src/adapters/compatibility/background-session/runtime.d.ts
3597
- interface BackgroundSessionSupervisorOptions extends Pick<BackgroundSessionSupervisorOptions$1, "clock" | "config" | "deliver" | "deliveries" | "onError" | "sleep"> {
3598
- readonly repository: BackgroundSessionRepository;
3599
- readonly runStep: (input: {
3600
- readonly session: BackgroundSessionState;
3601
- readonly signal: AbortSignal;
3602
- readonly wakeText: string;
3603
- }) => Promise<{
3604
- readonly finalText: string;
3605
- readonly runId: string;
3606
- }>;
3607
- }
3608
- declare function createBackgroundSessionSupervisor(options: BackgroundSessionSupervisorOptions): BackgroundSessionSupervisor;
3609
- //#endregion
3610
- //#region src/adapters/agent/background-session/background-session-host-tools.d.ts
3611
- interface CreateBackgroundSessionHostToolsOptions {
3612
- readonly createSessionId: () => string;
3613
- readonly definition: ResolvedRivusAgentDefinition;
3614
- readonly service: BackgroundSessionService;
3615
- }
3616
- declare function createBackgroundSessionHostTools(options: CreateBackgroundSessionHostToolsOptions): ReadonlyArray<RivusHostToolDescriptor>;
3617
- //#endregion
3618
- //#region src/adapters/compatibility/background-session/authority.d.ts
3619
- declare function extendBackgroundSessionDefinition<T extends BackgroundSessionAgentDefinition>(definition: T): TransformedBackgroundSessionDefinition<T>;
3620
- declare function narrowBackgroundSessionDefinition<T extends BackgroundSessionAgentDefinition>(definition: T): TransformedBackgroundSessionDefinition<T>;
3621
- //#endregion
3622
- //#region src/core/application/background-session/supervision/background-session-config.d.ts
3623
- declare const DEFAULT_BACKGROUND_SESSION_STEP_TIMEOUT_MS: number;
3624
- declare const DEFAULT_BACKGROUND_SESSION_MAX_CONCURRENT_SESSIONS = 4;
3625
- declare const DEFAULT_BACKGROUND_SESSION_LEASE_MS = 30000;
3626
- declare const DEFAULT_BACKGROUND_SESSION_LEASE_RENEWAL_INTERVAL_MS = 10000;
3627
- declare const DEFAULT_BACKGROUND_SESSION_MAX_CONSECUTIVE_FAILURES = 3;
3628
- declare const DEFAULT_BACKGROUND_SESSION_RETRY_BACKOFF_MS = 30000;
3629
- declare const DEFAULT_BACKGROUND_SESSION_LIFETIME_MS: number;
3630
- declare const DEFAULT_BACKGROUND_SESSION_SUPERVISOR_INTERVAL_MS = 1000;
3631
- declare function resolveBackgroundSessionSupervisorIntervalMs(leaseMs: number): number;
3632
- //#endregion
3633
- //#region src/adapters/feishu/background-session/background-session-delivery.d.ts
3634
- type FeishuBackgroundSessionDeliveryKind = "progress" | "final" | "stopped" | "failed" | "reconciliation";
3635
- interface FeishuBackgroundSessionDeliveryInput {
3636
- readonly chatId: string;
3637
- readonly deliveryId: string;
3638
- readonly displayName: string;
3639
- readonly kind: FeishuBackgroundSessionDeliveryKind;
3640
- readonly sessionId: string;
3641
- readonly text: string;
3642
- }
3643
- interface FeishuBackgroundSessionDelivery {
3644
- deliver(input: FeishuBackgroundSessionDeliveryInput): Promise<{
3645
- readonly providerMessageId: string;
3646
- }>;
3647
- }
3648
- /**
3649
- * Background sessions keep the transport-authenticated Feishu conversation id
3650
- * (`feishu:<tenant>:<chat>:<thread>`) as their stable origin. Feishu's send
3651
- * API, however, accepts only the raw chat id. Keep the translation at the
3652
- * Feishu adapter boundary and retain support for older sessions that stored a
3653
- * raw chat id directly.
3654
- */
3655
- declare function resolveFeishuDeliveryChatId(conversationId: string): string;
3656
- declare function createConfiguredFeishuBackgroundSessionDelivery(options: {
3657
- readonly client: FeishuOpenApiClient;
3658
- readonly config: RivusDaemonConfig;
3659
- }): FeishuBackgroundSessionDelivery;
3660
- declare function createBackgroundSessionCard(input: {
3661
- readonly displayName: string;
3662
- readonly kind: FeishuBackgroundSessionDeliveryKind;
3663
- readonly sessionId: string;
3664
- readonly text: string;
3665
- }): FeishuRawCardJson;
3666
- //#endregion
3667
- //#region src/adapters/compatibility/memory/public-contract.d.ts
3668
- declare function createMemoryNamespace(binding: MemoryBinding): string;
3669
- declare function restrictMemoryScopesForAudience(scopes: ReadonlyArray<MemoryScope>, audience: MemoryInvocationAudience): ReadonlyArray<MemoryScope>;
3670
- //#endregion
3671
- //#region src/adapters/agent/memory/rivus-memory-tool.d.ts
3672
- interface RivusMemoryTool {
3673
- execute(command: {
3674
- readonly command: "forget_request";
3675
- readonly id: string;
3676
- readonly reason?: string;
3677
- }): Promise<MemoryTombstoneReceipt>;
3678
- execute(command: {
3679
- readonly command: "propose";
3680
- readonly input: {
3681
- readonly content: string;
3682
- };
3683
- readonly scope?: Exclude<MemoryScope, "shared-user-profile">;
3684
- }): Promise<MemoryRecord>;
3685
- execute(command: {
3686
- readonly command: "read";
3687
- readonly id: string;
3688
- }): Promise<MemoryRecord | undefined>;
3689
- execute(command: {
3690
- readonly command: "search";
3691
- readonly query: MemorySearchQuery;
3692
- readonly scope?: MemoryScope;
3693
- }): Promise<ReadonlyArray<MemoryRecord>>;
3694
- replayCompleted(command: unknown, completedResult: unknown): Promise<unknown>;
3695
- }
3696
- interface MemoryTombstoneReceipt {
3697
- readonly id: string;
3698
- readonly revision: number;
3699
- readonly scope: MemoryScope;
3700
- readonly state: "tombstoned";
3701
- }
3702
- declare function createRivusMemoryTool(memory: AgentMemoryHandle | ReadonlyArray<AgentMemoryHandle>): RivusMemoryTool;
3703
- declare function createRivusMemoryToolDescriptor(options: {
3704
- readonly memory: AgentMemoryService;
3705
- }): RivusHostToolDescriptor;
3706
- //#endregion
3707
- //#region src/adapters/agent/memory/rivus-memory-tool-contract.d.ts
3708
- declare const RIVUS_MEMORY_TOOL_ID = "memory";
3709
- declare const RIVUS_MEMORY_TOOL_PLUGIN_ID = "rivus-core";
3710
- declare const RIVUS_MEMORY_TOOL_VERSION = "1.0.0";
3711
- declare function createRivusMemoryToolContract(scopes: ReadonlyArray<MemoryScope>): Readonly<{
3712
- description: "Search and read Memory inside Host-bound scopes; propose or request forgetting only in writable private scopes.";
3713
- digest: "sha256:rivus-memory-v3";
3714
- id: "memory";
3715
- idempotency: "required";
3716
- inputSchema: Readonly<{
3717
- additionalProperties: false;
3718
- properties: {
3719
- scope?: {
3720
- description: string;
3721
- enum: ("conversation" | "agent-private" | "project" | "shared-user-profile")[];
3722
- type: string;
3723
- };
3724
- command: {
3725
- description: string;
3726
- enum: string[];
3727
- type: string;
3728
- };
3729
- id: {
3730
- description: string;
3731
- minLength: number;
3732
- type: string;
3733
- };
3734
- input: {
3735
- additionalProperties: boolean;
3736
- description: string;
3737
- properties: {
3738
- content: {
3739
- minLength: number;
3740
- type: string;
3741
- };
3742
- };
3743
- required: string[];
3744
- type: string;
3745
- };
3746
- query: {
3747
- additionalProperties: boolean;
3748
- description: string;
3749
- properties: {
3750
- query: {
3751
- type: string;
3752
- };
3753
- };
3754
- required: string[];
3755
- type: string;
3756
- };
3757
- reason: {
3758
- description: string;
3759
- type: string;
3760
- };
3761
- };
3762
- required: string[];
3763
- type: "object";
3764
- }>;
3765
- risk: "mutate";
3766
- version: "1.0.0";
3767
- }>;
3768
- //#endregion
3769
- //#region src/adapters/agent/memory/project-memory-prompt-preparer.d.ts
3770
- interface ProjectMemoryRecallOptions {
3771
- readonly agentId: string;
3772
- readonly memory: AgentMemoryService;
3773
- readonly projectId: string;
3774
- readonly maxBytes?: number;
3775
- readonly maxRecords?: number;
3776
- readonly identity?: ProjectMemoryRecallIdentity;
3777
- }
3778
- interface ProjectMemoryRecallIdentity {
3779
- readonly subjectId: string;
3780
- readonly tenantId: string;
3781
- }
3782
- interface ProjectMemoryPromptInput {
3783
- readonly invocation?: AgentInvocationOrigin;
3784
- readonly text: string;
3785
- }
3786
- declare function createProjectMemoryPromptPreparer(options: ProjectMemoryRecallOptions): (input: ProjectMemoryPromptInput) => Promise<string>;
3787
- //#endregion
3788
- //#region src/adapters/compatibility/agent-execution/loop/agent-loop-prompt-transformer.d.ts
3789
- declare function createAgentLoopPromptTransformer(options: {
3790
- readonly loop: AgentLoop;
3791
- readonly transform: (input: AgentLoopInput) => Promise<string> | string;
3792
- }): AgentLoop;
3793
- //#endregion
3794
- //#region src/core/application/deployment/manifest/deployment-manifest.d.ts
3795
- declare class InvalidRivusProjectSpace extends Error {
3796
- readonly name = "InvalidRivusProjectSpace";
3797
- }
3798
- declare function validateRivusDeploymentManifest(manifest: RivusDeploymentManifest): void;
3799
- //#endregion
3800
- //#region src/adapters/deployment/project-space/node-project-space-resolver.d.ts
3801
- declare function resolveRivusProjectSpace(input: {
3802
- readonly declaration: RivusProjectSpaceDeployment;
3803
- readonly deploymentRoot: string;
3804
- }): Promise<ResolvedRivusProjectSpace>;
3805
- //#endregion
3806
- //#region src/adapters/pi/skills/project-skill-catalog.d.ts
3807
- interface ProjectSkillCatalogEntry {
3808
- readonly name: string;
3809
- }
3810
- interface ProjectSkillCatalogDiagnostic {
3811
- readonly message: string;
3812
- readonly path?: string;
3813
- readonly type: "warning" | "error" | "collision";
3814
- }
3815
- declare class InvalidProjectSkillCatalog extends Error {
3816
- readonly name = "InvalidProjectSkillCatalog";
3817
- }
3818
- declare function validateProjectSkillCatalog(input: {
3819
- readonly diagnostics: ReadonlyArray<ProjectSkillCatalogDiagnostic>;
3820
- readonly skills: ReadonlyArray<ProjectSkillCatalogEntry>;
3821
- }): ReadonlySet<string>;
3822
- declare function validateProjectSkillCommand(text: string, skillNames: ReadonlySet<string>): void;
3823
- //#endregion
3824
- //#region src/adapters/compatibility/memory/service/jsonl-agent-memory-service.d.ts
3825
- declare function openJsonlAgentMemoryService(options: {
3826
- readonly filePath: string;
3827
- }): Promise<AgentMemoryService>;
3828
- //#endregion
3829
- //#region src/core/application/agent-execution/context/agent-context-assembler.d.ts
3830
- type AgentContextLayerKind = "host-safety" | "system-prompt" | "managed-instructions" | "workspace-instructions" | "tool-schema" | "skill" | "memory" | "compaction" | "transcript" | "current-input";
3831
- interface AgentContextLayer {
3832
- readonly kind: AgentContextLayerKind;
3833
- readonly content: string;
3834
- }
3835
- interface AgentContextInput {
3836
- readonly hostSafety: string;
3837
- readonly systemPrompt: string;
3838
- readonly managedInstructions?: string;
3839
- readonly workspaceInstructions?: ReadonlyArray<string>;
3840
- readonly toolSchemas: ReadonlyArray<string>;
3841
- readonly skills?: ReadonlyArray<string>;
3842
- readonly memory?: ReadonlyArray<string>;
3843
- readonly compaction?: string;
3844
- readonly transcript?: ReadonlyArray<string>;
3845
- readonly currentInput: string;
3846
- readonly maxBytes: number;
3847
- }
3848
- interface AssembledAgentContext {
3849
- readonly layers: ReadonlyArray<AgentContextLayer>;
3850
- readonly omittedKinds: ReadonlyArray<AgentContextLayerKind>;
3851
- readonly bytes: number;
3852
- }
3853
- declare class AgentContextBudgetExceeded extends Error {
3854
- readonly name = "AgentContextBudgetExceeded";
3855
- }
3856
- declare function assembleAgentContext(input: AgentContextInput): AssembledAgentContext;
3857
- //#endregion
3858
- //#region src/core/application/memory/ports/compactor.d.ts
3859
- interface CompactionInput {
3860
- readonly tenantId: string;
3861
- readonly agentId: string;
3862
- readonly instanceId: string;
3863
- readonly conversationId: string;
3864
- readonly profileRevision: string;
3865
- readonly watermark: number;
3866
- readonly transcript: ReadonlyArray<string>;
3867
- }
3868
- //#endregion
3869
- //#region src/core/application/memory/compaction/compaction-service.d.ts
3870
- interface CompactionSnapshot extends Omit<CompactionInput, "transcript"> {
3871
- readonly id: string;
3872
- readonly summary: string;
3873
- }
3874
- declare class CompactionError extends Error {
3875
- readonly name = "CompactionError";
3876
- }
3877
- //#endregion
3878
- //#region src/adapters/compatibility/memory/compaction/compaction-service.d.ts
3879
- interface CompactorPort {
3880
- compact(input: CompactionInput): Promise<string>;
3881
- }
3882
- interface CompactionService {
3883
- createCandidate(input: CompactionInput): Promise<CompactionSnapshot>;
3884
- commit(candidateId: string): CompactionSnapshot;
3885
- current(instanceId: string, conversationId: string): CompactionSnapshot | undefined;
3886
- }
3887
- declare function createCompactionService(options: {
3888
- readonly compactor: CompactorPort;
3889
- }): CompactionService;
3890
- //#endregion
3891
- //#region src/adapters/compatibility/automation/automation-mandate-store.d.ts
3892
- declare function createAutomationMandateStore(): AutomationMandateStore;
3893
- //#endregion
3894
- //#region src/adapters/compatibility/automation/automation-tick-record.d.ts
3895
- type AutomationTickStatus = "running" | "failed" | "generated" | "suppressed" | "delivered";
3896
- interface AutomationTickRecord {
3897
- readonly automationId: string;
3898
- readonly body?: string;
3899
- readonly error?: string;
3900
- readonly occurrence: string;
3901
- readonly mandateId: string;
3902
- readonly providerMessageId?: string;
3903
- readonly presentation?: AutomationPresentation;
3904
- readonly revision: number;
3905
- readonly runId?: string;
3906
- readonly suppressionReason?: string;
3907
- readonly status: AutomationTickStatus;
3908
- readonly tickId: string;
3909
- }
3910
- //#endregion
3911
- //#region src/adapters/compatibility/automation/scheduled-automation.d.ts
3912
- interface ScheduledAutomationClock {
3913
- now(): Date;
3914
- sleep(milliseconds: number, signal: AbortSignal): Promise<void>;
3915
- }
3916
- interface ScheduledAutomationOptions {
3917
- readonly automationId: string;
3918
- readonly binding: AutomationBinding;
3919
- readonly clock?: ScheduledAutomationClock;
3920
- readonly createInput: (tick: {
3921
- readonly occurrence: string;
3922
- }) => {
3923
- readonly text: string;
3924
- };
3925
- readonly deliver: (input: ScheduledAutomationDeliveryInput) => Promise<{
3926
- readonly providerMessageId: string;
3927
- }>;
3928
- readonly repository: AutomationTickRepositoryCompatibility;
3929
- readonly onError?: (error: unknown) => Promise<void> | void;
3930
- readonly retryDelayMs?: number;
3931
- readonly run: (input: ScheduledAutomationRunInput) => Promise<ScheduledAutomationRunResult>;
3932
- }
3933
- interface AutomationTickRepositoryCompatibility {
3934
- get(automationId: string, occurrence: string): Promise<AutomationTickRecord | undefined>;
3935
- put(record: AutomationTickRecord): Promise<AutomationTickRecord>;
3936
- }
3937
- interface ScheduledAutomation {
3938
- running(): boolean;
3939
- runDue(at: Date): Promise<AutomationTickRecord | undefined>;
3940
- start(): Promise<void>;
3941
- stop(): Promise<void>;
3942
- }
3943
- declare function createScheduledAutomation(options: ScheduledAutomationOptions): ScheduledAutomation;
3944
- //#endregion
3945
- //#region src/core/application/automation/policy/daily-automation-schedule.d.ts
3946
- interface DailyAutomationSchedule {
3947
- currentOccurrence(now: Date): string | undefined;
3948
- nextOccurrence(now: Date): Date;
3949
- }
3950
- declare function createDailyAutomationSchedule(expression: string, timeZone: string, now?: Date): DailyAutomationSchedule;
3951
- //#endregion
3952
- //#region src/adapters/compatibility/automation/json-automation-tick-repository.d.ts
3953
- interface OpenJsonAutomationTickRepositoryOptions {
3954
- readonly filePath: string;
3955
- }
3956
- declare function openJsonAutomationTickRepository(options: OpenJsonAutomationTickRepositoryOptions): Promise<AutomationTickRepositoryCompatibility>;
3957
- //#endregion
3958
- //#region src/core/application/automation/outcome/automation-outcome.d.ts
3959
- type AutomationOutcome = {
3960
- readonly kind: "suppressed";
3961
- } | {
3962
- readonly kind: "report" | "alert";
3963
- readonly body: string;
3964
- readonly target: string;
3965
- };
3966
- interface PluginStateRecord {
3967
- readonly pluginId: string;
3968
- readonly agentId: string;
3969
- readonly key: string;
3970
- readonly value: unknown;
3971
- readonly revision: number;
3972
- }
3973
- interface PutPluginState {
3974
- readonly pluginId: string;
3975
- readonly agentId: string;
3976
- readonly key: string;
3977
- readonly value: unknown;
3978
- readonly expectedRevision: number;
3979
- }
3980
- type DeliveryJobStatus = "pending" | "delivered" | "reconciliation-required";
3981
- interface DeliveryJob {
3982
- readonly id: string;
3983
- readonly tickId: string;
3984
- readonly kind: "report" | "alert";
3985
- readonly body: string;
3986
- readonly target: string;
3987
- readonly status: DeliveryJobStatus;
3988
- readonly receiptId?: string;
3989
- }
3990
- type DeliveryAttemptResult = {
3991
- readonly kind: "delivered";
3992
- readonly providerMessageId: string;
3993
- } | {
3994
- readonly kind: "uncertain";
3995
- };
3996
- interface CommittedAutomationOutcome {
3997
- readonly state: PluginStateRecord;
3998
- readonly job?: DeliveryJob;
3999
- }
4000
- //#endregion
4001
- //#region src/adapters/compatibility/automation/outcome/plugin-state-store.d.ts
4002
- interface PluginStateStore {
4003
- get(pluginId: string, agentId: string, key: string): PluginStateRecord | undefined;
4004
- put(input: PutPluginState): PluginStateRecord;
4005
- }
4006
- declare class PluginStateConflict extends Error {
4007
- readonly name = "PluginStateConflict";
4008
- }
4009
- declare function createPluginStateStore(): PluginStateStore;
4010
- //#endregion
4011
- //#region src/adapters/compatibility/automation/outcome/delivery-outbox.d.ts
4012
- interface DeliveryOutbox {
4013
- enqueue(job: Omit<DeliveryJob, "status">): DeliveryJob;
4014
- recordAttempt(id: string, result: DeliveryAttemptResult): DeliveryJob;
4015
- snapshot(): ReadonlyArray<DeliveryJob>;
4016
- }
4017
- declare class DeliveryOutboxError extends Error {
4018
- readonly name = "DeliveryOutboxError";
4019
- }
4020
- declare function createDeliveryOutbox(): DeliveryOutbox;
4021
- //#endregion
4022
- //#region src/adapters/compatibility/automation/outcome/commit-automation-outcome.d.ts
4023
- interface CommitAutomationOutcomeInput {
4024
- readonly tickId: string;
4025
- readonly outcome: AutomationOutcome;
4026
- readonly state: PluginStateStore;
4027
- readonly stateUpdate: PutPluginState;
4028
- readonly outbox: DeliveryOutbox;
4029
- }
4030
- declare function commitAutomationOutcome(input: CommitAutomationOutcomeInput): CommittedAutomationOutcome;
4031
- //#endregion
4032
- //#region src/core/application/delegation/contracts/delegation.d.ts
4033
- interface DelegationEdge {
4034
- readonly fromAgentId: string;
4035
- readonly toAgentId: string;
4036
- readonly toolIds: ReadonlyArray<string>;
4037
- readonly maxHops: number;
4038
- readonly maxBudget: number;
4039
- }
4040
- interface DelegationRequest {
4041
- readonly callerAuthority: InvocationAuthorityRef$1;
4042
- readonly targetAgentId: string;
4043
- readonly targetInstanceId: string;
4044
- readonly targetToolGrantSet: RivusToolGrantSet;
4045
- readonly requestedToolIds: ReadonlyArray<string>;
4046
- readonly hopCount: number;
4047
- readonly budget: number;
4048
- }
4049
- interface DelegationGrant {
4050
- readonly id: string;
4051
- readonly request: DelegationRequest;
4052
- readonly toolGrantSet: RivusToolGrantSet;
4053
- readonly authority: InvocationAuthorityRef$1;
4054
- }
4055
- //#endregion
4056
- //#region src/core/application/delegation/grant/delegation-service.d.ts
4057
- declare class DelegationDenied extends Error {
4058
- readonly name = "DelegationDenied";
4059
- }
4060
- //#endregion
4061
- //#region src/adapters/compatibility/delegation/delegation-service.d.ts
4062
- interface DelegationService {
4063
- delegate(request: DelegationRequest): DelegationGrant;
4064
- }
4065
- declare function createDelegationService(options: {
4066
- readonly edges: ReadonlyArray<DelegationEdge>;
4067
- }): DelegationService;
4068
- declare function intersectToolIds(sets: ReadonlyArray<ReadonlyArray<string>>): RivusToolGrantSet;
4069
- //#endregion
4070
- //#region src/core/application/delegation/contracts/subagent.d.ts
4071
- interface SpawnSubagentRequest {
4072
- readonly parentAuthority: InvocationAuthorityRef$1;
4073
- readonly childAgentId: string;
4074
- readonly childProfileToolIds: ReadonlyArray<string>;
4075
- readonly childDeploymentToolIds: ReadonlyArray<string>;
4076
- readonly requestedToolIds: ReadonlyArray<string>;
4077
- }
4078
- interface SubagentCapabilities {
4079
- readonly senderIdentity: false;
4080
- readonly privateMemory: false;
4081
- readonly shell: false;
4082
- }
4083
- interface SubagentRecord {
4084
- readonly id: string;
4085
- readonly parentRunId: string;
4086
- readonly childAgentId: string;
4087
- readonly status: "active" | "cancelled";
4088
- readonly toolGrantSet: RivusToolGrantSet;
4089
- readonly authority: InvocationAuthorityRef$1;
4090
- readonly capabilities: SubagentCapabilities;
4091
- }
4092
- //#endregion
4093
- //#region src/adapters/compatibility/delegation/subagent-coordinator.d.ts
4094
- interface SubagentCoordinator {
4095
- spawn(request: SpawnSubagentRequest): SubagentRecord;
4096
- cancelParent(parentRunId: string): void;
4097
- get(id: string): SubagentRecord | undefined;
4098
- }
4099
- declare function createSubagentCoordinator(): SubagentCoordinator;
4100
- //#endregion
4101
- //#region src/core/application/deployment/resolution/deployment-resolution.d.ts
4102
- declare class RivusPluginLoadError extends Error {
4103
- readonly pluginId: string;
4104
- readonly moduleSpecifier: string;
4105
- readonly name = "RivusPluginLoadError";
4106
- constructor(pluginId: string, moduleSpecifier: string, message: string, options?: ErrorOptions);
4107
- }
4108
- //#endregion
4109
- //#region src/adapters/compatibility/deployment-control/rivus-plugin-loader.d.ts
4110
- type RivusPluginModule = RivusPlugin | {
4111
- readonly default: RivusPlugin | (() => RivusPlugin | Promise<RivusPlugin>);
4112
- };
4113
- interface LoadRivusDeploymentOptions {
4114
- readonly deploymentRoot: string;
4115
- readonly manifest: RivusDeploymentManifest;
4116
- readonly loadModule: (request: RivusPluginModuleLoadRequest) => Promise<RivusPluginModule> | RivusPluginModule;
4117
- }
4118
- declare function loadRivusDeployment(options: LoadRivusDeploymentOptions): Promise<LoadedRivusDeployment>;
4119
- //#endregion
4120
- //#region src/adapters/deployment/plugin/node-rivus-plugin-module-loader.d.ts
4121
- interface NodeRivusPluginModuleLoaderOptions {
4122
- readonly packageManifestPath?: string;
4123
- }
4124
- //#endregion
4125
- //#region src/adapters/compatibility/deployment-control/node-rivus-plugin-module-loader.d.ts
4126
- declare function loadNodeRivusPluginModule(request: RivusPluginModuleLoadRequest, options?: NodeRivusPluginModuleLoaderOptions): Promise<RivusPluginModule>;
4127
- //#endregion
4128
- //#region src/adapters/compatibility/deployment-control/rivus-deployment-daemon.d.ts
4129
- interface RivusDeploymentEndpoint {
4130
- running(): boolean;
4131
- start(): Promise<void> | void;
4132
- stop(): Promise<void> | void;
4133
- }
4134
- interface RivusDeploymentAutomation {
4135
- running(): boolean;
4136
- start(): Promise<void> | void;
4137
- stop(): Promise<void> | void;
4138
- }
4139
- interface RivusDeploymentBackgroundSession {
4140
- running(): boolean;
4141
- start(): Promise<void> | void;
4142
- status?(): BackgroundSessionSupervisorStatus;
4143
- stop(): Promise<void> | void;
4144
- }
4145
- interface CreateRivusDeploymentAutomationInput {
4146
- readonly automationId: string;
4147
- readonly definition: ResolvedRivusAutomationDefinition;
4148
- readonly deliveryEndpoint: RivusEndpointDeployment;
4149
- readonly instanceId: string;
4150
- readonly run: (input: ScheduledAutomationRunInput) => Promise<unknown>;
4151
- }
4152
- interface CreateRivusDeploymentEndpointInput {
4153
- readonly agentId: string;
4154
- readonly cancel: (input: AgentRuntimeCancellation) => Promise<boolean>;
4155
- readonly endpointId: string;
4156
- readonly definition: RivusEndpointDeployment;
4157
- readonly handle: (input: RivusEndpointInput) => Promise<unknown>;
4158
- readonly steer?: (input: AgentRuntimeSteering) => Promise<boolean>;
4159
- readonly instanceId: string;
4160
- readonly projectSpaceId?: string;
4161
- }
4162
- interface CreateRivusDeploymentBackgroundSessionInput {
4163
- readonly agentIds: ReadonlyArray<string>;
4164
- readonly config: RivusBackgroundSessionsDeployment;
4165
- readonly cancel: (input: {
4166
- readonly agentId: string;
4167
- readonly reason?: string;
4168
- readonly runId: string;
4169
- readonly sessionKey: SessionKey;
4170
- }) => Promise<boolean>;
4171
- readonly run: (input: {
4172
- readonly agentId: string;
4173
- readonly invocation: AgentInvocationOrigin;
4174
- readonly onUpdate?: (update: AgentRunUpdate) => void | Promise<void>;
4175
- readonly sessionKey: SessionKey;
4176
- readonly text: string;
4177
- }) => Promise<unknown>;
4178
- }
4179
- interface CreateRivusDeploymentRuntimeInput extends AgentInstanceRecord {
4180
- readonly catalog: RivusPluginCatalog;
4181
- readonly definition: ResolvedRivusAgentDefinition;
4182
- readonly projectSpace?: ResolvedRivusProjectSpace;
4183
- }
4184
- interface CreateRivusDeploymentDaemonOptions {
4185
- readonly deploymentRoot: string;
4186
- readonly manifest: RivusDeploymentManifest;
4187
- readonly loadModule: (request: RivusPluginModuleLoadRequest) => Promise<RivusPluginModule> | RivusPluginModule;
4188
- readonly initialInstanceRecords?: AgentInstanceRegistryOptions["initialRecords"];
4189
- readonly createRuntime: (input: CreateRivusDeploymentRuntimeInput) => PooledAgentRuntime | Promise<PooledAgentRuntime>;
4190
- readonly createEndpoint: (input: CreateRivusDeploymentEndpointInput) => RivusDeploymentEndpoint | Promise<RivusDeploymentEndpoint>;
4191
- readonly createAutomation?: (input: CreateRivusDeploymentAutomationInput) => RivusDeploymentAutomation | Promise<RivusDeploymentAutomation>;
4192
- readonly createBackgroundSession?: (input: CreateRivusDeploymentBackgroundSessionInput) => RivusDeploymentBackgroundSession | Promise<RivusDeploymentBackgroundSession>;
4193
- readonly resolveProjectSpace?: (input: {
4194
- readonly declaration: RivusProjectSpaceDeployment;
4195
- readonly deploymentRoot: string;
4196
- }) => Promise<ResolvedRivusProjectSpace> | ResolvedRivusProjectSpace;
4197
- }
4198
- interface RivusEndpointInput extends AgentRuntimeInput {}
4199
- interface RivusDeploymentDaemon {
4200
- readonly deployment: LoadedRivusDeployment;
4201
- handleDefault(input: RivusEndpointInput): Promise<unknown>;
4202
- handleEndpoint(endpointId: string, input: RivusEndpointInput): Promise<unknown>;
4203
- runDefaultAgent(input: RivusEndpointInput): Promise<unknown>;
4204
- running(): boolean;
4205
- start(): Promise<void>;
4206
- status(): RivusDeploymentDaemonStatus;
4207
- stop(): Promise<void>;
4208
- }
4209
- //#endregion
4210
- //#region src/bootstrap/deployment/rivus-deployment-daemon.d.ts
4211
- declare function createRivusDeploymentDaemon(options: CreateRivusDeploymentDaemonOptions): Promise<RivusDeploymentDaemon>;
4212
- //#endregion
4213
- //#region src/adapters/deployment/manifest/node-rivus-deployment-manifest.d.ts
4214
- interface LoadRivusDeploymentManifestOptions {
4215
- readonly maxBytes?: number;
4216
- }
4217
- declare class RivusDeploymentManifestError extends Error {
4218
- readonly manifestPath: string;
4219
- readonly name = "RivusDeploymentManifestError";
4220
- constructor(manifestPath: string, message: string, options?: ErrorOptions);
4221
- }
4222
- //#endregion
4223
- //#region src/adapters/compatibility/deployment-control/rivus-deployment-manifest.d.ts
4224
- declare function loadRivusDeploymentManifest(manifestPath: string, options?: LoadRivusDeploymentManifestOptions): Promise<RivusDeploymentManifest>;
4225
- //#endregion
4226
- //#region src/bootstrap/deployment/configured-rivus-deployment-daemon.d.ts
4227
- type CreateConfiguredRivusDeploymentDaemonOptions = Omit<CreateRivusDeploymentDaemonOptions, "deploymentRoot" | "loadModule" | "manifest"> & {
4228
- readonly manifestPath: string;
4229
- readonly manifestOptions?: LoadRivusDeploymentManifestOptions;
4230
- readonly pluginPackageManifestPath?: string;
4231
- };
4232
- declare function createConfiguredRivusDeploymentDaemon(options: CreateConfiguredRivusDeploymentDaemonOptions): Promise<RivusDeploymentDaemon>;
4233
- //#endregion
4234
- //#region src/adapters/compatibility/human-interaction/snapshot.d.ts
4235
- interface ApprovedHumanInteractionState extends ApprovedHumanInteractionState$1 {}
4236
- interface CancelledHumanInteractionState extends CancelledHumanInteractionState$1 {}
4237
- interface ExpiredHumanInteractionState extends ExpiredHumanInteractionState$1 {}
4238
- interface HumanInteractionActor extends HumanInteractionActor$1 {}
4239
- interface HumanInteractionBase extends HumanInteractionBase$1 {}
4240
- interface HumanInteractionFact extends HumanInteractionFact$1 {}
4241
- type HumanInteractionId = HumanInteractionId$1;
4242
- type HumanInteractionResolutionAction = HumanInteractionResolutionAction$1;
4243
- type HumanInteractionTransition = HumanInteractionTransition$1;
4244
- interface PendingHumanInteractionState extends PendingHumanInteractionState$1 {}
4245
- interface RejectedHumanInteractionState extends RejectedHumanInteractionState$1 {}
4246
- interface RequestToolApprovalInput extends RequestToolApprovalInput$1 {}
4247
- interface RequestUserDecisionInput extends RequestUserDecisionInput$1 {}
4248
- interface SelectedHumanInteractionState extends SelectedHumanInteractionState$1 {}
4249
- interface ToolApprovalBinding extends ToolApprovalBinding$1 {}
4250
- type ToolApprovalInteractionState = ToolApprovalInteractionState$1;
4251
- type UserDecisionInteractionState = UserDecisionInteractionState$1;
4252
- interface UserDecisionOption extends UserDecisionOption$1 {}
4253
- type HumanInteraction = ToolApprovalInteraction | UserDecisionInteraction;
4254
- interface ToolApprovalInteraction extends ToolApprovalInteraction$1 {}
4255
- interface UserDecisionInteraction extends UserDecisionInteraction$1 {}
4256
- //#endregion
4257
- //#region src/adapters/compatibility/human-interaction/transitions.d.ts
4258
- declare class HumanInteractionTransitionDenied extends Error {
4259
- readonly name = "HumanInteractionTransitionDenied";
4260
- }
4261
- declare function transitionHumanInteraction(interaction: HumanInteraction, transition: HumanInteractionTransition): HumanInteraction;
4262
- //#endregion
4263
- //#region src/adapters/compatibility/human-interaction/presenter.d.ts
4264
- interface HumanInteractionPresenter extends HumanInteractionPresenterContract<HumanInteraction> {}
4265
- //#endregion
4266
- //#region src/adapters/compatibility/human-interaction/repository.d.ts
4267
- interface HumanInteractionRepository extends HumanInteractionRepositoryContract<HumanInteraction> {}
4268
- //#endregion
4269
- //#region src/adapters/compatibility/human-interaction/service.d.ts
4270
- interface HumanInteractionClock extends HumanInteractionClock$1 {}
4271
- interface ResolveHumanInteractionInput extends ResolveHumanInteractionInput$1 {}
4272
- interface ConsumeToolApprovalInput extends ConsumeToolApprovalInput$1 {}
4273
- interface HumanInteractionService extends HumanInteractionServiceContract<HumanInteraction, ToolApprovalInteraction, UserDecisionInteraction, RequestToolApprovalInput, RequestUserDecisionInput, ResolveHumanInteractionInput, ConsumeToolApprovalInput> {}
4274
- interface HumanInteractionServiceOptions extends HumanInteractionServiceOptionsContract<HumanInteractionClock, HumanInteractionPresenter, HumanInteractionRepository> {}
4275
- declare function createHumanInteractionService(options: HumanInteractionServiceOptions): HumanInteractionService;
4276
- //#endregion
4277
- //#region src/adapters/compatibility/human-interaction/endpoint-registry.d.ts
4278
- interface HumanInteractionEndpointRegistry {
4279
- register(endpointId: string, service: HumanInteractionService): void;
4280
- resolve(endpointId: string): HumanInteractionService | undefined;
4281
- services(): ReadonlyArray<HumanInteractionService>;
4282
- }
4283
- declare function createHumanInteractionEndpointRegistry(): HumanInteractionEndpointRegistry;
4284
- //#endregion
4285
- //#region src/adapters/compatibility/human-interaction/tool-approval-gateway.d.ts
4286
- declare function createHumanInteractionToolApprovalGateway(options: {
4287
- readonly clock?: {
4288
- readonly now: () => string;
4289
- };
4290
- readonly expiresAfterMs?: number;
4291
- readonly registry: HumanInteractionEndpointRegistry;
4292
- }): PiToolApprovalGateway;
4293
- //#endregion
4294
- //#region src/core/application/tool-execution/brokerage/model-change-authorization-contracts.d.ts
4295
- /** A Host-maintained grant. No field in this contract comes from the CLI request. */
4296
- interface ModelManagementGrant {
4297
- readonly bindingRevision: string;
4298
- readonly budget: Omit<ModelChangeBudgetLimits, "identity" | "deadlineAt">;
4299
- readonly enabled: boolean;
4300
- readonly endpointId: string;
4301
- readonly homeId: string;
4302
- readonly operations: ReadonlyArray<ModelChangeOperation>;
4303
- readonly ownerId: string;
4304
- readonly provider: string;
4305
- readonly revision: number;
4306
- /** Host policy requiring a durable human decision before this request can run. */
4307
- readonly requireApproval?: boolean;
4308
- readonly tenantKey: string;
4309
- readonly timeoutMs: number;
4310
- }
4311
- interface ModelChangeApprovalInput {
4312
- /** Present only while creating the interaction from a live trusted Run. */
4313
- readonly authority?: ModelChangeApprovalAuthority;
4314
- readonly budget: ModelManagementGrant["budget"];
4315
- readonly expiresAt: string;
4316
- readonly grantRevision: number;
4317
- readonly interactionId: string;
4318
- readonly principal: ModelChangePrincipal;
4319
- readonly request: ModelChangeSubmission;
4320
- }
4321
- interface ModelChangeApprovalAuthority {
4322
- readonly agentId: string;
4323
- readonly endpointId?: string;
4324
- readonly instanceId: string;
4325
- readonly runId: string;
4326
- readonly sessionKey: string;
4327
- readonly sourceMessageId: string;
4328
- readonly tenantKey: string;
4329
- }
4330
- type ModelChangeApprovalStatus = {
4331
- readonly status: "approved";
4332
- } | {
4333
- readonly reason?: string;
4334
- readonly status: "pending";
4335
- } | {
4336
- readonly reason?: string;
4337
- readonly status: "rejected";
4338
- };
4339
- /** Durable approval adapter. Initial authorization must stay non-blocking; accepted workers may wait. */
4340
- interface ModelChangeApprovalPort {
4341
- requestOrGet(input: ModelChangeApprovalInput): Effect.Effect<ModelChangeApprovalStatus, unknown>;
4342
- waitForResolution(input: ModelChangeApprovalInput): Effect.Effect<ModelChangeApprovalStatus, unknown>;
4343
- }
4344
- //#endregion
4345
- //#region src/adapters/compatibility/human-interaction/model-change-approval.d.ts
4346
- /** Route accepted model requests through the existing durable human decision service. */
4347
- declare function createHumanInteractionModelChangeApproval(options: {
4348
- readonly endpointId: string;
4349
- readonly registry: HumanInteractionEndpointRegistry;
4350
- }): ModelChangeApprovalPort;
4351
- //#endregion
4352
- //#region src/adapters/compatibility/human-interaction/routed-tool-approval-service.d.ts
4353
- declare function createRoutedHumanInteractionToolApprovalService(registry: HumanInteractionEndpointRegistry): ToolApprovalService;
4354
- //#endregion
4355
- //#region src/adapters/feishu/delivery/feishu-text-reply.d.ts
4356
- interface FeishuTextReplySender {
4357
- reply(messageId: string, text: string): Effect.Effect<void, unknown>;
4358
- }
4359
- declare function createConfiguredFeishuTextReplySender(options: {
4360
- readonly client: FeishuOpenApiClient;
4361
- readonly config: RivusDaemonConfig;
4362
- }): FeishuTextReplySender;
4363
- //#endregion
4364
- //#region src/adapters/feishu/delivery/feishu-message-reaction.d.ts
4365
- interface FeishuMessageReactionSender {
4366
- add(messageId: string, emojiType?: string): Effect.Effect<void, unknown>;
4367
- }
4368
- declare function createConfiguredFeishuMessageReactionSender(options: {
4369
- readonly client: FeishuOpenApiClient;
4370
- readonly config: RivusDaemonConfig;
4371
- }): FeishuMessageReactionSender;
4372
- //#endregion
4373
- //#region src/adapters/feishu/automation/automation-card-sender.d.ts
4374
- interface FeishuAutomationCardInput {
4375
- readonly idempotencyKey: string;
4376
- readonly markdown: string;
4377
- readonly presentation?: AutomationPresentation;
4378
- readonly receiveId: string;
4379
- readonly receiveIdType: RivusAutomationDeliveryTargetType;
4380
- }
4381
- interface FeishuAutomationCardSender {
4382
- send(input: FeishuAutomationCardInput): Effect.Effect<{
4383
- readonly providerMessageId: string;
4384
- }, unknown>;
4385
- }
4386
- declare function createConfiguredFeishuAutomationCardSender(options: {
4387
- readonly client: FeishuOpenApiClient;
4388
- readonly config: RivusDaemonConfig;
4389
- }): FeishuAutomationCardSender;
4390
- //#endregion
4391
- //#region src/adapters/outbound/persistence/human-interaction/jsonl-human-interaction-repository.d.ts
4392
- interface JsonlHumanInteractionRepositoryOptions {
4393
- readonly filePath: string;
4394
- }
4395
- //#endregion
4396
- //#region src/adapters/compatibility/human-interaction/persistence.d.ts
4397
- declare function createInMemoryHumanInteractionRepository(): HumanInteractionRepository;
4398
- declare function createJsonlHumanInteractionRepository(options: JsonlHumanInteractionRepositoryOptions): HumanInteractionRepository;
4399
- //#endregion
4400
- //#region src/adapters/compatibility/human-interaction/feishu.d.ts
4401
- declare function createFeishuHumanInteractionCard(interaction: HumanInteraction): FeishuRawCardJson;
4402
- interface FeishuHumanInteractionPresenterOptions {
4403
- readonly baseUrl?: string;
4404
- readonly client: FeishuOpenApiClient;
4405
- }
4406
- declare function createFeishuHumanInteractionPresenter(options: FeishuHumanInteractionPresenterOptions): HumanInteractionPresenter;
4407
- interface ConfiguredFeishuHumanInteractionPresenterOptions {
4408
- readonly client: FeishuOpenApiClient;
4409
- readonly config: RivusDaemonConfig;
4410
- }
4411
- declare function createConfiguredFeishuHumanInteractionPresenter(options: ConfiguredFeishuHumanInteractionPresenterOptions): HumanInteractionPresenter;
4412
- //#endregion
4413
- //#region src/adapters/feishu/run-presentation/feishu-agent-run-card.d.ts
4414
- declare const FEISHU_AGENT_CARD_ELEMENT_ID = "rivus_agent_answer";
4415
- declare const FEISHU_AGENT_CARD_PROGRESS_ELEMENT_ID = "rivus_agent_progress";
4416
- type FeishuAgentRunCardInput = {
4417
- readonly agentName: string;
4418
- readonly elementId?: string;
4419
- readonly generation?: number;
4420
- readonly runId: string;
4421
- readonly sessionKey: string;
4422
- readonly status: "running"; /** Disable only when a deployment has not subscribed to the modern card.action.trigger callback. */
4423
- readonly cancelButton?: boolean;
4424
- readonly presentation?: RunPresentation;
4425
- readonly progressDisplay?: ConversationProgressDisplay;
4426
- readonly text?: string;
4427
- } | {
4428
- readonly agentName: string;
4429
- readonly presentation?: RunPresentation;
4430
- readonly progressDisplay?: ConversationProgressDisplay;
4431
- readonly status: "completed";
4432
- readonly text: string;
4433
- } | {
4434
- readonly agentName: string;
4435
- readonly presentation?: RunPresentation;
4436
- readonly progressDisplay?: ConversationProgressDisplay;
4437
- readonly reason?: string;
4438
- readonly status: "cancelled";
4439
- readonly text?: string;
4440
- } | {
4441
- readonly agentName: string;
4442
- readonly presentation?: RunPresentation;
4443
- readonly progressDisplay?: ConversationProgressDisplay;
4444
- readonly status: "failed";
4445
- };
4446
- declare function createFeishuAgentRunCard(input: FeishuAgentRunCardInput): FeishuRawCardJson;
4447
- //#endregion
4448
- export { UserDecisionInteraction as $, AgentModelOutputObservation as $a, CardPresentation as $c, FeishuAgentExecutionResult as $d, FeishuStreamAction as $f, createRateLimitedFeishuPublisher as $i, AgentRuntime as $l, DEFAULT_BACKGROUND_SESSION_STEP_TIMEOUT_MS as $n, AgentEventLogStoreError as $o, RivusEndpointDefinition as $r, createBackgroundSessionToolContracts as $s, ScheduledAutomationClock as $t, AgentRuntimeSteering as $u, createHumanInteractionService as A, PiAgentSession as Aa, RivusDaemonShutdownController as Ac, FeishuInboxLeasedState as Ad, UnsupportedFeishuMessage as Af, InvalidWorkspaceRoot as Ai, FeishuMessagePreparedControl as Al, createProjectMemoryPromptPreparer as An, JsonFileFeishuCardTargetRegistryOptions as Ao, AgentRunUpdateListener as Ap, renewBackgroundSessionLease as Ar, RivusDeploymentBootstrapAdapters as As, DelegationEdge as At, AgentDomainEventSinkCallback as Au, HumanInteractionBase as B, createOpenTelemetryAgentTelemetry as Ba, RivusDaemonStatusReporterOptions as Bc, ToolOperationRecoveryItem as Bd, createFeishuConversationId as Bf, createFixedClock as Bi, RivusEnvFileVariables as Bl, restrictMemoryScopesForAudience as Bn, FeishuCardKitTextUpdate as Bo, AgentEventSinkFailed as Bp, AgentMemoryService as Br, RivusDeploymentBackgroundSessionStatus as Bs, createPluginStateStore as Bt, JsonHttpRequest as Bu, HumanInteractionEndpointRegistry as C, PiSessionRegistry as Ca, ScheduledAutomationRunResult as Cc, ToolOperationRecord as Cd, FeishuNewSessionMessageIntakeSummary as Cf, requiresToolApproval as Ci, FeishuReceiveMessageReplayOptions as Cl, resolveRivusProjectSpace as Cn, FeishuCardRolloverSupervisor as Co, AgentHarnessBusyAvailability as Cp, createBackgroundSession as Cr, RivusDaemonBootstrapModule as Cs, createSubagentCoordinator as Ct, AgentClientFailure as Cu, HumanInteractionService as D, PiAgentSessionHandle as Da, AutomationMandateError as Dc, FeishuInboxDeadState as Dd, describeFeishuMessageIntake as Df, WorkspaceInstructionsProvider as Di, FeishuEndpointGroupPolicy as Dl, ProjectMemoryPromptInput as Dn, FeishuCardTargetRegistry as Do, AgentRunSnapshot as Dp, isBackgroundSessionTerminalPhase as Dr, RivusDaemonPromptRunner as Ds, createDelegationService as Dt, AgentTextDeltaCallback as Du, HumanInteractionClock as E, PiAgentLoopOptions as Ea, AutomationMandate as Ec, FeishuInboxCompletedState as Ed, createAgentCommandFromFeishuMessage as Ef, normalizeStableJson as Ei, FeishuReceiveRuntimeStatus as El, createAgentLoopPromptTransformer as En, FeishuCardTargetNotFound as Eo, AgentPromptResult as Ep, isBackgroundSessionLeaseExpired as Er, RivusDaemonFeishuReplayRunner as Es, DelegationService as Et, AgentSessionClient as Eu, ApprovedHumanInteractionState as F, initialAgentRunState as Fa, RivusDaemonStatusHttpServer as Fc, DeadLetterRecoveryItem as Fd, FeishuSessionStoreOptions as Ff, WorkspaceInstructionsRequest as Fi, MergePiProviderBaseUrlOverrideOptions as Fl, MemoryTombstoneReceipt as Fn, FeishuCardKitFail as Fo, AgentSessionOwnedBusyAvailability as Fp, AgentMemoryServiceOptions as Fr, RivusDeploymentAutomationLifecycle as Fs, DeliveryOutbox as Ft, AgentHarnessOptions as Fu, PendingHumanInteractionState as G, LangfuseTelemetryConfig as Ga, FeishuCardRolloverEventType as Gc, FeishuAgentDaemonHandleResult as Gd, openJsonlFeishuCardDeliveryLedger as Gf, createFeishuPeriodicFlush as Gi, resolveFeishuEndpointCredentials as Gl, createConfiguredFeishuBackgroundSessionDelivery as Gn, FeishuWebSocketDaemon as Go, DEFAULT_CONVERSATION_PROGRESS_DISPLAY as Gp, MemoryRecord as Gr, RivusDeploymentReadinessError as Gs, PluginStateRecord as Gt, SessionSchedulerDisposed as Gu, HumanInteractionId as H, TelemetryContentRedactorOptions as Ha, FeishuCardRollover as Hc, FeishuAgentDaemon as Hd, FeishuReceiveMessagePayload as Hf, createTestClock as Hi, formatRivusEnvFile as Hl, FeishuBackgroundSessionDeliveryInput as Hn, createFeishuCardKitPublisher as Ho, AgentLoopFailed as Hp, MEMORY_SCOPES as Hr, RivusDeploymentDaemonStatus as Hs, CommittedAutomationOutcome as Ht, createJsonFetchRequest as Hu, CancelledHumanInteractionState as I, isTerminalAgentRunPhase as Ia, RivusDaemonStatusHttpServerOptions as Ic, DeadLetterRequeueResult as Id, createFeishuSessionStore as If, WorkspaceInstructionsView as Ii, mergePiProviderBaseUrlOverride as Il, RivusMemoryTool as In, FeishuCardKitFinish as Io, AgentSessionSnapshot as Ip, createAgentMemoryService as Ir, RivusDeploymentAutomationReadinessError as Is, DeliveryOutboxError as It, createAgentHarness as Iu, RequestUserDecisionInput as J, LangfuseTelemetryEnv as Ja, FeishuCardRolloverStatus as Jc, FeishuAgentDaemonRunResult as Jd, FeishuCardDeliveryReconciler as Jf, FeishuCoalescingPublisher as Ji, RivusDaemonConfigLoaderOptions as Jl, DEFAULT_BACKGROUND_SESSION_LEASE_RENEWAL_INTERVAL_MS as Jn, FeishuWebSocketRuntime as Jo, MemoryState as Jr, BACKGROUND_SESSION_START_TOOL_ID as Js, openJsonAutomationTickRepository as Jt, createSessionScheduler as Ju, RejectedHumanInteractionState as K, LangfuseTelemetryConfigError as Ka, FeishuCardRolloverHandoffResult as Kc, FeishuAgentDaemonInteractionResult as Kd, FeishuCardDeliveryLedger as Kf, ConfiguredFeishuCardKitPublisherOptions as Ki, RivusDaemonConfig as Kl, resolveFeishuDeliveryChatId as Kn, FeishuWebSocketDaemonOptions as Ko, MemoryScope as Kr, RivusDeploymentComponentLifecycle as Ks, PutPluginState as Kt, SessionSchedulerOptions as Ku, ExpiredHumanInteractionState as L, OpenTelemetryAgentEventSinkOptions as La, createRivusDaemonStatusHttpServer as Lc, RecoveryAction as Ld, FeishuConversationReference as Lf, WorkspaceRootHandle as Li, OpenClawEnvImportError as Ll, createRivusMemoryTool as Ln, FeishuCardKitPresentationUpdate as Lo, PromptCommand as Lp, AgentMemoryAuthority as Lr, RivusDeploymentAutomationStatus as Ls, createDeliveryOutbox as Lt, FetchLike as Lu, HumanInteractionPresenter as M, PiCreateAgentSessionResult as Ma, RivusDaemonShutdownSignal as Mc, FeishuInboxRepository as Md, FeishuSessionEpochRecord as Mf, WorkspaceInstructionSource as Mi, FeishuMessageQueueOptions as Ml, RIVUS_MEMORY_TOOL_PLUGIN_ID as Mn, createJsonFileFeishuCardTargetRegistry as Mo, AgentSessionBusyAvailability as Mp, requeueInterruptedBackgroundSessionStep as Mr, RivusDeploymentBootstrapFactory as Ms, DelegationRequest as Mt, createAgentDomainEventHandler as Mu, HumanInteractionTransitionDenied as N, PiSdkAgentLoopOptions as Na, RivusDaemonSignalSource as Nc, FeishuInboxRepositoryStateOptions as Nd, FeishuSessionResetResult as Nf, WorkspaceInstructionsDiagnostic as Ni, createFeishuMessageQueue as Nl, RIVUS_MEMORY_TOOL_VERSION as Nn, FeishuCardKitCancel as No, AgentSessionHandle as Np, resolveBackgroundSessionReconciliation as Nr, RivusDeploymentCliProcess as Ns, CommitAutomationOutcomeInput as Nt, createAgentDomainEventSinkFromCallback as Nu, HumanInteractionServiceOptions as O, createPiAgentLoop as Oa, AutomationMandateStore as Oc, FeishuInboxDelivery as Od, FeishuMessageContentInput as Of, createAgentsMdInstructionsProvider as Oi, shouldAcceptFeishuEndpointMessage as Ol, ProjectMemoryRecallIdentity as On, FeishuCardTargetRegistryOperation as Oo, AgentRunUpdate as Op, parkBackgroundSessionForReconciliation as Or, RivusDaemonRecoveryRunner as Os, intersectToolIds as Ot, createAgentHarnessClient as Ou, transitionHumanInteraction as P, evolveAgentRun as Pa, createRivusDaemonShutdownController as Pc, createFeishuInboxRepository as Pd, FeishuSessionStore as Pf, WorkspaceInstructionsDiagnosticCode as Pi, FeishuMessageAcceptResult as Pl, createRivusMemoryToolContract as Pn, FeishuCardKitClient as Po, AgentSessionOtherBusyAvailability as Pp, suspendBackgroundSession as Pr, createRivusDeploymentCliProcess as Ps, commitAutomationOutcome as Pt, createAgentRunUpdateHandler as Pu, ToolApprovalInteractionState as Q, AgentModelInputObservation as Qa, FeishuCardPresentationStore as Qc, FeishuAgentExecution as Qd, createFeishuCardDeliveryReconciler as Qf, RateLimitedFeishuPublisherOptions as Qi, loadRivusDaemonConfig as Ql, DEFAULT_BACKGROUND_SESSION_RETRY_BACKOFF_MS as Qn, AgentEventLogOperation as Qo, RivusAgentHostOptions as Qr, backgroundSessionToolIds as Qs, ScheduledAutomation as Qt, AgentRuntimePoolOptions as Qu, HumanInteraction as R, OpenTelemetryAgentTelemetry as Ra, RivusDaemonStatus as Rc, RecoveryControl as Rd, FeishuSessionReference as Rf, createRivusPluginCatalog as Ri, OpenClawEnvImportOptions as Rl, createRivusMemoryToolDescriptor as Rn, FeishuCardKitPublisher as Ro, RunIdGenerator as Rp, AgentMemoryHandle as Rr, RivusDeploymentBackgroundSessionLifecycle as Rs, PluginStateConflict as Rt, FetchLikeResponse as Ru, createHumanInteractionToolApprovalGateway as S, createRunPresentationProjector as Sa, ScheduledAutomationRunInput as Sc, ToolOperationReconciliationOutcome as Sd, FeishuNewSessionCommand as Sf, createToolInputDigest as Si, FeishuReceiveHandledObservation as Sl, validateProjectSkillCommand as Sn, createFeishuTenantAccessTokenProvider as So, AgentHarnessAvailability as Sp, completeBackgroundSessionStop as Sr, RivusDaemonBootstrapFactory as Ss, SubagentCoordinator as St, AgentClientAttempt as Su, ConsumeToolApprovalInput as T, createPiSessionRegistry as Ta, AutomationDeliveryBinding as Tc, createToolOperationLedger as Td, FeishuPromptMessageIntakeSummary as Tf, InvalidToolInput as Ti, FeishuReceiveMessageSummary as Tl, validateRivusDeploymentManifest as Tn, createFeishuCardRolloverSupervisor as To, AgentHarnessIdleAvailability as Tp, isBackgroundSessionDue as Tr, RivusDaemonCliWriter as Ts, SubagentRecord as Tt, AgentHarnessClient as Tu, HumanInteractionResolutionAction as U, createTelemetryContentRedactor as Ua, FeishuCardRolloverCounters as Uc, FeishuAgentDaemonCancelResult as Ud, HumanInteractionRepositoryError as Uf, FeishuPeriodicFlush as Ui, FeishuEndpointCredentialError as Ul, FeishuBackgroundSessionDeliveryKind as Un, FeishuWebSocketClient as Uo, AgentRunCancelled as Up, MemoryBinding as Ur, RivusDeploymentEndpointLifecycle as Us, DeliveryJob as Ut, SessionScheduler as Uu, HumanInteractionFact as V, TelemetryContentRedactor as Va, createRivusDaemonStatusReporter as Vc, ToolOperationResolutionResult as Vd, createFeishuSessionKey as Vf, createSequenceRunIds as Vi, createRivusEnvFromOpenClawConfig as Vl, FeishuBackgroundSessionDelivery as Vn, FeishuCardTarget as Vo, AgentHarnessBusy as Vp, AgentMemorySnapshot as Vr, RivusDeploymentDaemonLifecycle as Vs, AutomationOutcome as Vt, JsonHttpResponse as Vu, HumanInteractionTransition as W, LangfuseAgentTelemetry as Wa, FeishuCardRolloverEvent as Wc, FeishuAgentDaemonHandleMessageOptions as Wd, JsonlFeishuCardDeliveryLedgerOptions as Wf, FeishuPeriodicFlushOptions as Wi, FeishuEndpointCredentials as Wl, createBackgroundSessionCard as Wn, FeishuWebSocketClientStartOptions as Wo, ConversationProgressDisplay as Wp, MemoryInvocationAudience as Wr, RivusDeploymentEndpointStatus as Ws, DeliveryJobStatus as Wt, SessionSchedulerCapacityExceeded as Wu, ToolApprovalBinding as X, resolveLangfuseTelemetryConfig as Xa, DEFAULT_CARD_STREAM_LEASE_MS as Xc, FeishuAgentDaemonSkippedResult as Xd, FeishuCardDeliveryRecord as Xf, createCoalescingFeishuPublisher as Xi, RivusTextFileReader as Xl, DEFAULT_BACKGROUND_SESSION_MAX_CONCURRENT_SESSIONS as Xn, createLazyFeishuWebSocketEventDispatcher as Xo, InvalidRivusEndpointBinding as Xr, BACKGROUND_SESSION_TOOL_PLUGIN_ID as Xs, createDailyAutomationSchedule as Xt, AgentRuntimeInput as Xu, SelectedHumanInteractionState as Y, createLangfuseAgentTelemetry as Ya, createFeishuCardRollover as Yc, FeishuAgentDaemonSessionResetResult as Yd, FeishuCardDeliveryReconcilerOptions as Yf, FeishuCoalescingPublisherOptions as Yi, RivusDaemonEnv as Yl, DEFAULT_BACKGROUND_SESSION_LIFETIME_MS as Yn, createFeishuWebSocketDaemon as Yo, AgentMemoryError as Yr, BACKGROUND_SESSION_TOOL_IDS as Ys, DailyAutomationSchedule as Yt, AgentRuntimeCancellation as Yu, ToolApprovalInteraction as Z, AgentModelContentObserver as Za, FeishuCardPresentationHandoffStart as Zc, FeishuAgentDaemonSteeredResult as Zd, createFeishuCardDeliveryLedger as Zf, FeishuStreamActionPublisher as Zi, RivusThinkingLevel as Zl, DEFAULT_BACKGROUND_SESSION_MAX_CONSECUTIVE_FAILURES as Zn, AgentEventLog as Zo, RivusAgentHost as Zr, BACKGROUND_SESSION_TOOL_VERSION as Zs, AutomationTickRepositoryCompatibility as Zt, AgentRuntimePool as Zu, createConfiguredFeishuMessageReactionSender as _, createFeishuCardKitOpenApiClient as _a, BackgroundSessionLimits as _c, ToolOperationBeginResult as _d, FeishuCancelRunCommand as _f, createToolBroker as _i, FeishuMessageWorkerOptions as _l, openJsonlAgentMemoryService as _n, FeishuTenantAccessTokenError as _o, AgentClock as _p, BackgroundSessionState as _r, FeishuCardActionToast as _s, loadNodeRivusPluginModule as _t, createDefaultAgentRuntime as _u, ConfiguredFeishuHumanInteractionPresenterOptions as a, createConfiguredFeishuCardKitTargetCreator as aa, RivusAgentDeploymentStatus as ac, AgentInstanceRegistryOptions as ad, FeishuPromptContextResolver as af, createFeishuDeploymentEndpoint as ai, isCardPresentationHandoffDue as al, CompactionService as an, restoreConfiguredRivusDaemonBootstrap as ao, PresentationStepStatus as ap, createBackgroundSessionHostTools as ar, FeishuAgentRuntime as as, LoadRivusDeploymentManifestOptions as at, DefaultAgentHarnessOptions as au, createRoutedHumanInteractionToolApprovalService as b, createFeishuCardPresentationStore as ba, AUTOMATION_SUPPRESSION_PREFIX as bc, ToolOperationLedger as bd, FeishuMessageIntakeOptions as bf, InvocationAuthorityRef as bi, FeishuMessageWorkerDrainAvailableResult as bl, ProjectSkillCatalogEntry as bn, FeishuTenantAccessTokenRequest as bo, AgentDomainEventSink as bp, claimBackgroundSession as br, FeishuRawCardJson as bs, loadRivusDeployment as bt, createSystemClock as bu, createFeishuHumanInteractionCard as c, FeishuCotProtocolError as ca, RivusAutomationDelivery as cc, AgentInstanceRecord as cd, FeishuCardActionCommand as cf, openJsonlRecoveryControl as ci, RivusDaemonProcess as cl, CompactionError as cn, createConfiguredFeishuCardRolloverRuntime as co, RunPresentation as cp, createBackgroundSessionRepository as cr, FeishuPeriodicFlushSupervisor as cs, CreateRivusDeploymentAutomationInput as ct, DefaultAgentRuntimeOptions as cu, createJsonlHumanInteractionRepository as d, FeishuCotRunPreparation as da, RivusBackgroundSessionsDeployment as dc, JsonlFeishuInboxRepositoryOptions as dd, FeishuResolveInteractionCommand as df, AuthorizationPolicyState as di, RivusDaemonWorkerLoop as dl, AgentContextBudgetExceeded as dn, FeishuOpenApiClient as do, ToolPresentationStep as dp, openJsonlBackgroundSessionDeliveryStore as dr, FeishuEventHandlers as ds, CreateRivusDeploymentEndpointInput as dt, createDefaultAgentHarness as du, FeishuCardKitOpenApiTargetCreatorOptions as ea, isBackgroundSessionToolId as ec, PooledAgentRuntime as ed, FeishuAgentMessageSideEffects as ef, RivusEndpointInput$1 as ei, CardPresentationChain as el, ScheduledAutomationOptions as en, ConfiguredRivusDaemonBootstrap as eo, FeishuStreamProjector as ep, DEFAULT_BACKGROUND_SESSION_SUPERVISOR_INTERVAL_MS as er, JsonlAgentEventLogOptions as es, UserDecisionInteractionState as et, DefaultAgentHarnessClientFromCallbackOptions as eu, JsonlHumanInteractionRepositoryOptions as f, createFeishuCotPublisher as fa, RivusDeploymentManifest as fc, openJsonlFeishuInboxRepository as fd, InvalidFeishuCardAction as ff, ToolApprovalRequest as fi, createRivusDaemonProcess as fl, AgentContextInput as fn, FeishuOpenApiError as fo, hasInspectableRunProgress as fp, createBackgroundSessionDeliveryStore as fr, FeishuEventHandlersOptions as fs, CreateRivusDeploymentRuntimeInput as ft, createDefaultAgentHarnessClient as fu, FeishuMessageReactionSender as g, FeishuCardKitOpenApiClientOptions as ga, RivusProjectSpaceDeployment as gc, createRecoveryControl as gd, FeishuCancelMessageIntakeSummary as gf, ToolExecutionRequest as gi, FeishuMessageWorker as gl, assembleAgentContext as gn, createFeishuOpenApiClient as go, ActiveAgentRun as gp, BackgroundSessionRepository as gr, FeishuCardActionCallbackResponse as gs, RivusDeploymentEndpoint as gt, createDefaultAgentHarnessFromTextCallback as gu, createConfiguredFeishuAutomationCardSender as h, createFeishuTopicContextResolver as ha, RivusPluginDeclaration as hc, RecoveryControlOptions as hd, FeishuAgentCommand as hf, ToolBrokerOptions as hi, createFeishuWorkerLoop as hl, AssembledAgentContext as hn, createConfiguredFeishuOpenApiClient as ho, createPresentedValue as hp, createBackgroundSessionService as hr, createFeishuEventHandlers as hs, RivusDeploymentDaemon as ht, createDefaultAgentHarnessFromCallback as hu, createFeishuAgentRunCard as i, FeishuCardTargetPreparationOptions as ia, ResolvedRivusProjectSpace as ic, AgentInstanceConflict as id, FeishuPromptContextInput as if, FeishuDeploymentEndpointOptions as ii, activeCardPresentation as il, createAutomationMandateStore as in, createConfiguredRivusDaemonBootstrap as io, PresentationStep as ip, CreateBackgroundSessionHostToolsOptions as ir, createAgentDomainEventSink as is, loadRivusDeploymentManifest as it, DefaultAgentHarnessFromTextCallbackOptions as iu, HumanInteractionRepository as j, PiAgentSessionEvent as ja, RivusDaemonShutdownControllerOptions as jc, FeishuInboxPendingState as jd, readFeishuMessageContent as jf, WorkspaceInstructionsSourceError as ji, FeishuMessageQueue as jl, RIVUS_MEMORY_TOOL_ID as jn, createInMemoryFeishuCardTargetRegistry as jo, AgentSessionAvailability as jp, requestBackgroundSessionStop as jr, RivusDeploymentBootstrapContext as js, DelegationGrant as jt, AgentRunUpdateCallback as ju, ResolveHumanInteractionInput as k, createPiSdkAgentLoop as ka, AutomationTick as kc, FeishuInboxDeliveryState as kd, InvalidFeishuMessageContent as kf, createWorkspaceRootHandle as ki, FeishuMessageDrainResult as kl, ProjectMemoryRecallOptions as kn, FeishuCardTargetRegistryStoreError as ko, AgentRunUpdateHandler as kp, releaseBackgroundSessionLease as kr, runRivusDaemonCli as ks, DelegationDenied as kt, AgentDomainEventCallback as ku, createFeishuHumanInteractionPresenter as l, FeishuCotPublisher as la, RivusAutomationDeliveryTargetType as lc, OpenJsonFeishuSessionStoreOptions as ld, FeishuCardActionIntakeError as lf, openJsonlToolOperationLedger as li, RivusDaemonProcessOptions as ll, CompactionSnapshot as ln, ConfiguredFeishuOpenApiRequest as lo, RunPresentationPhase as lp, openJsonlBackgroundSessionRepository as lr, FeishuEventHandlerCardActions as ls, CreateRivusDeploymentBackgroundSessionInput as lt, DefaultAgentRuntimeSessionOptions as lu, FeishuAutomationCardSender as m, InvalidFeishuTopicContext as ma, RivusEndpointExperimentalFeatures as mc, createRecoveryAction as md, createAgentCommandFromFeishuCardAction as mf, ToolBroker as mi, FeishuWorkerLoopOptions as ml, AgentContextLayerKind as mn, FeishuOpenApiResponse as mo, PresentedValueOptions as mp, isBackgroundSessionState as mr, FeishuSdkReceiveMessagePayload as ms, RivusDeploymentBackgroundSession as mt, createDefaultAgentHarnessClientFromTextCallback as mu, FEISHU_AGENT_CARD_PROGRESS_ELEMENT_ID as n, FeishuCardTargetCreateOptions as na, LoadedRivusDeployment as nc, AgentInstanceRegistry as nd, FeishuHumanInteractionActions as nf, FeishuPresentationPreparationOptions as ni, CardPresentationTransitionDenied as nl, AutomationTickRecord as nn, ConfiguredRivusDaemonBootstrapRequest as no, AssistantPresentationStep as np, extendBackgroundSessionDefinition as nr, AgentHistoryEventLog as ns, CreateConfiguredRivusDeploymentDaemonOptions as nt, DefaultAgentHarnessClientOptions as nu, FeishuHumanInteractionPresenterOptions as o, createFeishuCardKitOpenApiTargetCreator as oa, RivusPluginLoadStatus as oc, AgentInstanceBusy as od, composeFeishuTopicPrompt as of, createAgentHarnessPooledRuntime as oi, CompositeRivusDaemonTransportOptions as ol, CompactorPort as on, ConfiguredFeishuCardRolloverRuntime as oo, RUN_PRESENTATION_SCHEMA_VERSION as op, BackgroundSessionSupervisorOptions as or, FeishuAgentRuntimeOptions as os, RivusDeploymentManifestError as ot, DefaultAgentRuntimeFromCallbackOptions as ou, FeishuAutomationCardInput as p, FeishuTopicContextResolverOptions as pa, RivusEndpointDeployment as pc, InvalidRecoveryAction as pd, UnsupportedFeishuCardAction as pf, ToolApprovalService as pi, FeishuWorkerLoop as pl, AgentContextLayer as pn, FeishuOpenApiRequest as po, PresentedValue as pp, BACKGROUND_SESSION_JSONL_VERSION as pr, FeishuReceiveMessageHandlerPayload as ps, RivusDeploymentAutomation as pt, createDefaultAgentHarnessClientFromCallback as pu, RequestToolApprovalInput as q, LangfuseTelemetryContentMode as qa, FeishuCardRolloverOptions as qc, FeishuAgentDaemonOptions as qd, FeishuCardDeliveryLedgerStateOptions as qf, createConfiguredFeishuCardKitPublisher as qi, RivusDaemonConfigError as ql, DEFAULT_BACKGROUND_SESSION_LEASE_MS as qn, FeishuWebSocketEventDispatcher as qo, MemorySearchQuery as qr, RivusDeploymentDaemonLifecycleError as qs, OpenJsonAutomationTickRepositoryOptions as qt, SessionSchedulerStatus as qu, FeishuAgentRunCardInput as r, FeishuCardTargetCreator as ra, ResolvedRivusAutomationDefinition as rc, createAgentInstanceRegistry as rd, createFeishuAgentDaemon as rf, createFeishuPresentationPreparation as ri, acceptsCardPresentationProgress as rl, AutomationTickStatus as rn, ConfiguredRivusDaemonBootstrapResponse as ro, ModelPresentationStep as rp, narrowBackgroundSessionDefinition as rr, restoreAgentHistory as rs, createConfiguredRivusDeploymentDaemon as rt, DefaultAgentHarnessFromCallbackOptions as ru, createConfiguredFeishuHumanInteractionPresenter as s, createFeishuCardTargetPreparation as sa, RivusPluginModuleLoadRequest as sc, AgentRuntimeDisposed as sd, FeishuAgentRunPreparation as sf, JsonlRecoveryControlOptions as si, createCompositeRivusDaemonTransport as sl, createCompactionService as sn, ConfiguredFeishuCardRolloverRuntimeOptions as so, ResponsePresentationStep as sp, createBackgroundSessionSupervisor as sr, createFeishuAgentRuntime as ss, createRivusDeploymentDaemon as st, DefaultAgentRuntimeFromTextCallbackOptions as su, FEISHU_AGENT_CARD_ELEMENT_ID as t, FeishuCardPresentationBinder as ta, ProcessDeploymentEndpoint as tc, createAgentRuntimePool as td, FeishuAgentPreparedControl as tf, createRivusAgentHost as ti, CardPresentationStatus as tl, createScheduledAutomation as tn, ConfiguredRivusDaemonBootstrapOptions as to, createFeishuStreamProjector as tp, resolveBackgroundSessionSupervisorIntervalMs as tr, createJsonlAgentEventLog as ts, UserDecisionOption as tt, DefaultAgentHarnessClientFromTextCallbackOptions as tu, createInMemoryHumanInteractionRepository as u, FeishuCotPublisherOptions as ua, RivusAutomationDeployment as uc, openJsonFeishuSessionStore as ud, FeishuCardActionTriggerPayload as uf, AuthorizationPolicyProvider as ui, RivusDaemonTransport as ul, CompactionInput as un, ConfiguredFeishuOpenApiResponse as uo, SkillPresentationStep as up, BACKGROUND_SESSION_DELIVERY_JSONL_VERSION as ur, FeishuEventHandlerQueue as us, CreateRivusDeploymentDaemonOptions as ut, createAgentRuntime as uu, FeishuTextReplySender as v, FeishuCardPresentationNotFound as va, BackgroundSessionSupervisor as vc, ToolOperationBinding as vd, FeishuMessageIntakeBaseSummary as vf, ToolInvocationDenied as vi, FeishuMessageWorkerQueue as vl, InvalidProjectSkillCatalog as vn, FeishuTenantAccessTokenProvider as vo, AgentDomainEventHandler as vp, BackgroundSessionTransitionDenied as vr, createFeishuCardActionCallbackResponse as vs, LoadRivusDeploymentOptions as vt, createDefaultAgentRuntimeFromCallback as vu, createHumanInteractionEndpointRegistry as w, PiSessionRegistryOptions as wa, AutomationBinding as wc, ToolOperationState as wd, FeishuPromptAgentCommand as wf, InvalidStableJson as wi, FeishuReceiveMessageReplayResult as wl, InvalidRivusProjectSpace as wn, FeishuCardRolloverSupervisorOptions as wo, AgentHarnessError as wp, failBackgroundSessionStep as wr, RivusDaemonCliOptions as ws, SpawnSubagentRequest as wt, AgentClientSuccess as wu, createHumanInteractionModelChangeApproval as x, RunPresentationProjector as xa, ScheduledAutomationDeliveryInput as xc, ToolOperationReconciliation as xd, FeishuMessageIntakeSummary as xf, createInvocationAuthority as xi, FeishuReceiveAcceptedObservation as xl, validateProjectSkillCatalog as xn, FeishuTenantAccessTokenResponse as xo, AgentHarness as xp, completeBackgroundSessionStep as xr, RivusDaemonBootstrapContext as xs, RivusPluginLoadError as xt, createUuidRunIds as xu, createConfiguredFeishuTextReplySender as y, FeishuCardPresentationStoreOptions as ya, BackgroundSessionSupervisorStatus as yc, ToolOperationInspectResult as yd, FeishuMessageIntakeError as yf, InvocationAuthority as yi, createFeishuMessageWorker as yl, ProjectSkillCatalogDiagnostic as yn, FeishuTenantAccessTokenProviderOptions as yo, AgentDomainEventListener as yp, appendBackgroundSessionInput as yr, createFeishuCardActionErrorResponse as ys, RivusPluginModule as yt, createDefaultAgentRuntimeFromTextCallback as yu, HumanInteractionActor as z, createOpenTelemetryAgentEventSink as za, RivusDaemonStatusReporter as zc, RecoverySnapshot as zd, InvalidFeishuSessionReference as zf, resolveRivusAgentDefinition as zi, OpenClawEnvImportResult as zl, createMemoryNamespace as zn, FeishuCardKitPublisherOptions as zo, AgentEventHandlerFailed as zp, AgentMemoryIdentity as zr, RivusDeploymentBackgroundSessionReadinessError as zs, PluginStateStore as zt, JsonFetchRequestOptions as zu };