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