@rivus/gateway 0.22.3 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/assets/audio-transcriber/THIRD_PARTY_NOTICES.md +1 -3
- package/assets/audio-transcriber/fetch-model.mjs +29 -21
- package/assets/audio-transcriber/npm-shrinkwrap.json +5 -63
- package/assets/audio-transcriber/package.json +1 -1
- package/assets/installation-policy.json +9 -4
- package/dist/bootstrap/feishu.d.ts +42 -3
- package/dist/bootstrap/feishu.js +11964 -12401
- package/dist/bootstrap/herdr-feishu.d.ts +8 -1
- package/dist/bootstrap/herdr-feishu.js +2 -2
- package/dist/chunks/dist.js +10371 -0
- package/dist/chunks/errors.js +13 -0
- package/dist/chunks/herdr-feishu-runtime.js +128 -395
- package/dist/chunks/herdr-socket-client.js +496 -0
- package/dist/chunks/public.d.ts +93 -63
- package/dist/chunks/public2.d.ts +0 -7
- package/dist/chunks/rivus-deployment-cli-process.d.ts +136 -353
- package/dist/chunks/rivus-node-entrypoint.js +1543 -1579
- package/dist/chunks/superagent-worker-programs.js +7240 -0
- package/dist/chunks/superagent-worker-wire.js +233 -0
- package/dist/index.d.ts +12 -25
- package/dist/index.js +2 -1
- package/dist/mcp.js +109 -24
- package/dist/superagent.d.ts +301 -0
- package/dist/superagent.js +2 -0
- package/package.json +25 -11
- package/dist/chunks/automation-presentation.js +0 -263
- package/dist/chunks/feishu-receive-message.js +0 -113
- package/dist/chunks/rivus-home-deployment-env.js +0 -1916
|
@@ -1,203 +1,51 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as AutomationAttemptGrantResult, d as AgentRuntimeCancellation, f as AgentRuntimeInput, m as ResolvedRivusAgentDefinition, p as AgentRuntimeSteering, s as RivusPluginCatalog, t as RegisteredRivusAutomation, x as ScheduledAutomationRunInput, y as AutomationOccurrenceRecoveryItem } from "./public.js";
|
|
2
2
|
import "./public2.js";
|
|
3
3
|
import { Context, Effect, Layer, Schema } from "effect";
|
|
4
4
|
import { AgentInvocationOrigin, AgentRunId, AgentRunUpdate, AttachmentAccess, SessionKey, UserInput } from "@rivus/runtime";
|
|
5
|
-
import "@rivus/
|
|
6
|
-
import {
|
|
7
|
-
//#region src/
|
|
8
|
-
type
|
|
9
|
-
|
|
10
|
-
readonly
|
|
11
|
-
|
|
12
|
-
readonly
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
17
|
-
readonly deliveryId: string;
|
|
18
|
-
readonly endpointId: string;
|
|
19
|
-
readonly failureCode: "delivery_failed";
|
|
20
|
-
readonly failureSummary: string;
|
|
21
|
-
readonly failedAt: string;
|
|
22
|
-
readonly revision: number;
|
|
23
|
-
}
|
|
24
|
-
interface DeadLetterRequeueResult {
|
|
25
|
-
readonly acceptedAt: string;
|
|
26
|
-
readonly attempts: 0;
|
|
27
|
-
readonly availableAt: string;
|
|
28
|
-
readonly deliveryId: string;
|
|
29
|
-
readonly endpointId: string;
|
|
30
|
-
readonly recoveredAt: string;
|
|
31
|
-
readonly recoveredBy: string;
|
|
32
|
-
readonly revision: number;
|
|
33
|
-
readonly status: "pending";
|
|
34
|
-
}
|
|
35
|
-
interface AutomationOccurrenceRecoveryItem {
|
|
36
|
-
readonly attempts: number;
|
|
37
|
-
readonly automationId: string;
|
|
38
|
-
readonly failureCode?: string;
|
|
39
|
-
readonly limit: number;
|
|
40
|
-
readonly occurrence: string;
|
|
41
|
-
readonly phase: "generation" | "delivery";
|
|
42
|
-
readonly revision: number;
|
|
43
|
-
readonly stopReason: "attempt-limit" | "terminal-failure";
|
|
44
|
-
}
|
|
45
|
-
interface AutomationAttemptGrantResult {
|
|
46
|
-
readonly attemptLimit: number;
|
|
47
|
-
readonly attempts: number;
|
|
48
|
-
readonly automationId: string;
|
|
49
|
-
readonly grantedAt: string;
|
|
50
|
-
readonly grantedBy: string;
|
|
51
|
-
readonly occurrence: string;
|
|
52
|
-
readonly revision: number;
|
|
53
|
-
readonly status: "failed" | "generated";
|
|
54
|
-
}
|
|
55
|
-
interface RecoverySnapshot {
|
|
56
|
-
readonly automationOccurrences: ReadonlyArray<AutomationOccurrenceRecoveryItem>;
|
|
57
|
-
readonly deadLetters: ReadonlyArray<DeadLetterRecoveryItem>;
|
|
58
|
-
readonly toolOperations: ReadonlyArray<ToolOperationRecoveryItem>;
|
|
5
|
+
import { createPiModelRuntime } from "@rivus/runtime/pi";
|
|
6
|
+
import { ProcessLockPlatform } from "@rivus/agent-kit-collab/process-lock";
|
|
7
|
+
//#region src/home/lib/rivus-home.d.ts
|
|
8
|
+
type RivusHomeEnvironment = Readonly<Record<string, string | undefined>>;
|
|
9
|
+
interface RivusHome {
|
|
10
|
+
readonly bootstrap: string;
|
|
11
|
+
readonly directory: string;
|
|
12
|
+
readonly envFilePath: string;
|
|
13
|
+
readonly logsDirectory: string;
|
|
14
|
+
readonly manifestPath: string;
|
|
15
|
+
readonly stateDirectory: string;
|
|
16
|
+
readonly workspaceDirectory: string;
|
|
59
17
|
}
|
|
60
|
-
interface
|
|
61
|
-
readonly
|
|
62
|
-
readonly
|
|
63
|
-
readonly instanceId: string;
|
|
64
|
-
readonly operationId: string;
|
|
65
|
-
readonly failureCode: "tool_outcome_unknown";
|
|
66
|
-
readonly failureSummary: string;
|
|
67
|
-
readonly revision: number;
|
|
68
|
-
readonly status: "reconciliation-required";
|
|
69
|
-
readonly toolId: string;
|
|
70
|
-
readonly toolVersion: string;
|
|
18
|
+
interface InitializedRivusHome {
|
|
19
|
+
readonly directory: string;
|
|
20
|
+
readonly files: ReadonlyArray<string>;
|
|
71
21
|
}
|
|
72
|
-
interface
|
|
73
|
-
readonly
|
|
74
|
-
readonly
|
|
75
|
-
readonly
|
|
76
|
-
readonly operationId: string;
|
|
77
|
-
readonly reconciledAt: string;
|
|
78
|
-
readonly reconciledBy: string;
|
|
79
|
-
readonly revision: number;
|
|
80
|
-
readonly status: "aborted" | "completed";
|
|
81
|
-
readonly toolId: string;
|
|
82
|
-
readonly toolVersion: string;
|
|
22
|
+
interface RivusHomeDoctorCheck {
|
|
23
|
+
readonly message: string;
|
|
24
|
+
readonly name: "node" | "home" | "workspace" | "modules" | "manifest" | "credentials";
|
|
25
|
+
readonly status: "pass" | "fail";
|
|
83
26
|
}
|
|
84
|
-
interface
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
readonly expectedRevision: number;
|
|
89
|
-
readonly note: string;
|
|
90
|
-
readonly occurrence: string;
|
|
91
|
-
}): Effect.Effect<AutomationAttemptGrantResult, unknown>;
|
|
92
|
-
inspect(): Effect.Effect<RecoverySnapshot, unknown>;
|
|
93
|
-
requeueDeadLetter(input: {
|
|
94
|
-
readonly actorId: string;
|
|
95
|
-
readonly deliveryId: string;
|
|
96
|
-
readonly endpointId: string;
|
|
97
|
-
readonly expectedRevision: number;
|
|
98
|
-
readonly note: string;
|
|
99
|
-
}): Effect.Effect<DeadLetterRequeueResult, unknown>;
|
|
100
|
-
resolveToolOperation(input: {
|
|
101
|
-
readonly actorId: string;
|
|
102
|
-
readonly expectedRevision: number;
|
|
103
|
-
readonly instanceId: string;
|
|
104
|
-
readonly note: string;
|
|
105
|
-
readonly operationId: string;
|
|
106
|
-
readonly outcome: RecoveryToolOperationOutcome;
|
|
107
|
-
}): Effect.Effect<ToolOperationResolutionResult, unknown>;
|
|
27
|
+
interface RivusHomeDoctorReport {
|
|
28
|
+
readonly checks: ReadonlyArray<RivusHomeDoctorCheck>;
|
|
29
|
+
readonly directory: string;
|
|
30
|
+
readonly ready: boolean;
|
|
108
31
|
}
|
|
109
32
|
//#endregion
|
|
110
|
-
//#region src/
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
interface ToolApprovalBinding {
|
|
122
|
-
readonly agentId: string;
|
|
123
|
-
readonly callId: string;
|
|
124
|
-
readonly inputDigest: string;
|
|
125
|
-
readonly instanceId: string;
|
|
126
|
-
readonly operationId: string;
|
|
127
|
-
readonly risk: HumanInteractionToolRisk;
|
|
128
|
-
readonly runId: string;
|
|
129
|
-
readonly sessionKey: string;
|
|
130
|
-
readonly tenantKey: string;
|
|
131
|
-
readonly toolId: string;
|
|
132
|
-
readonly toolVersion: string;
|
|
133
|
-
}
|
|
134
|
-
interface HumanInteractionBase {
|
|
135
|
-
readonly agentId: string;
|
|
136
|
-
readonly allowedActorOpenIds: ReadonlyArray<string>;
|
|
137
|
-
readonly createdAt: string;
|
|
138
|
-
readonly expiresAt: string;
|
|
139
|
-
readonly facts: ReadonlyArray<HumanInteractionFact>;
|
|
140
|
-
readonly id: HumanInteractionId;
|
|
141
|
-
readonly instanceId: string;
|
|
142
|
-
readonly revision: number;
|
|
143
|
-
readonly runId: string;
|
|
144
|
-
readonly sessionKey: string;
|
|
145
|
-
readonly sourceMessageId: string;
|
|
146
|
-
readonly summary: string;
|
|
147
|
-
readonly tenantKey: string;
|
|
148
|
-
readonly title: string;
|
|
149
|
-
}
|
|
150
|
-
interface PendingHumanInteractionState {
|
|
151
|
-
readonly status: "pending";
|
|
152
|
-
}
|
|
153
|
-
interface ApprovedHumanInteractionState {
|
|
154
|
-
readonly actor: HumanInteractionActor;
|
|
155
|
-
readonly consumedAt?: string;
|
|
156
|
-
readonly resolvedAt: string;
|
|
157
|
-
readonly status: "approved";
|
|
158
|
-
}
|
|
159
|
-
interface RejectedHumanInteractionState {
|
|
160
|
-
readonly actor: HumanInteractionActor;
|
|
161
|
-
readonly resolvedAt: string;
|
|
162
|
-
readonly status: "rejected";
|
|
163
|
-
}
|
|
164
|
-
interface SelectedHumanInteractionState {
|
|
165
|
-
readonly actor: HumanInteractionActor;
|
|
166
|
-
readonly optionId: string;
|
|
167
|
-
readonly resolvedAt: string;
|
|
168
|
-
readonly status: "selected";
|
|
169
|
-
}
|
|
170
|
-
interface ExpiredHumanInteractionState {
|
|
171
|
-
readonly expiredAt: string;
|
|
172
|
-
readonly status: "expired";
|
|
173
|
-
}
|
|
174
|
-
interface CancelledHumanInteractionState {
|
|
175
|
-
readonly cancelledAt: string;
|
|
176
|
-
readonly reason?: string;
|
|
177
|
-
readonly status: "cancelled";
|
|
178
|
-
}
|
|
179
|
-
type ToolApprovalInteractionState = PendingHumanInteractionState | ApprovedHumanInteractionState | RejectedHumanInteractionState | ExpiredHumanInteractionState | CancelledHumanInteractionState;
|
|
180
|
-
interface ToolApprovalInteraction extends HumanInteractionBase {
|
|
181
|
-
readonly kind: "tool-approval";
|
|
182
|
-
readonly request: Omit<ToolApprovalBinding, "agentId" | "instanceId" | "runId" | "sessionKey" | "tenantKey">;
|
|
183
|
-
readonly state: ToolApprovalInteractionState;
|
|
184
|
-
}
|
|
185
|
-
interface UserDecisionOption {
|
|
186
|
-
readonly description: string;
|
|
187
|
-
readonly id: string;
|
|
188
|
-
readonly label: string;
|
|
189
|
-
}
|
|
190
|
-
type UserDecisionInteractionState = PendingHumanInteractionState | SelectedHumanInteractionState | RejectedHumanInteractionState | ExpiredHumanInteractionState | CancelledHumanInteractionState;
|
|
191
|
-
interface UserDecisionInteraction extends HumanInteractionBase {
|
|
192
|
-
readonly kind: "user-decision";
|
|
193
|
-
readonly options: ReadonlyArray<UserDecisionOption>;
|
|
194
|
-
readonly recommendedOptionId?: string;
|
|
195
|
-
readonly state: UserDecisionInteractionState;
|
|
33
|
+
//#region src/home/infra/home-api.d.ts
|
|
34
|
+
interface RivusHomeApi {
|
|
35
|
+
diagnose(input: {
|
|
36
|
+
readonly directory: string;
|
|
37
|
+
readonly env: RivusHomeEnvironment;
|
|
38
|
+
readonly envFilePath?: string;
|
|
39
|
+
readonly nodeVersion: string;
|
|
40
|
+
}): Effect.Effect<RivusHomeDoctorReport, Error>;
|
|
41
|
+
load(directory: string): Effect.Effect<RivusHome, Error>;
|
|
42
|
+
setup(directory: string): Effect.Effect<InitializedRivusHome, Error>;
|
|
196
43
|
}
|
|
197
|
-
type HumanInteraction = ToolApprovalInteraction | UserDecisionInteraction;
|
|
198
|
-
type HumanInteractionSnapshot = HumanInteraction;
|
|
199
44
|
//#endregion
|
|
200
|
-
//#region src/
|
|
45
|
+
//#region src/home/infra/adapters/config/rivus-daemon-config.d.ts
|
|
46
|
+
type RivusDaemonEnv = Readonly<Record<string, string | undefined>>;
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/agent-host/domain/instance/agent-instance.d.ts
|
|
201
49
|
type AgentInstanceBinding = {
|
|
202
50
|
readonly kind: "endpoint";
|
|
203
51
|
readonly endpointId: string;
|
|
@@ -216,7 +64,7 @@ interface AgentInstanceRecord {
|
|
|
216
64
|
readonly runtimeGenerationId: string;
|
|
217
65
|
}
|
|
218
66
|
//#endregion
|
|
219
|
-
//#region src/background-session/domain/background-session/
|
|
67
|
+
//#region src/background-session/domain/background-session/phase.d.ts
|
|
220
68
|
type BackgroundSessionPhase = "queued" | "running" | "waiting" | "input-required" | "stopping" | "stopped" | "completed" | "failed" | "reconciliation-required";
|
|
221
69
|
//#endregion
|
|
222
70
|
//#region src/background-session/application/use-cases/background-session-supervisor.d.ts
|
|
@@ -239,7 +87,7 @@ interface BackgroundSessionSupervisorStatus {
|
|
|
239
87
|
readonly running: boolean;
|
|
240
88
|
}
|
|
241
89
|
//#endregion
|
|
242
|
-
//#region src/deployment/domain/manifest/
|
|
90
|
+
//#region src/deployment/domain/manifest/manifest.d.ts
|
|
243
91
|
interface RivusBackgroundSessionsDeployment {
|
|
244
92
|
readonly enabled: boolean;
|
|
245
93
|
readonly leaseMs: number;
|
|
@@ -265,6 +113,9 @@ interface RivusAutomationDeployment {
|
|
|
265
113
|
readonly required: boolean;
|
|
266
114
|
readonly schedule: string;
|
|
267
115
|
readonly templateId: string;
|
|
116
|
+
/** Runs and delivers the Automation through the Superagent instead of the conversation endpoint. */
|
|
117
|
+
readonly superagent?: boolean;
|
|
118
|
+
readonly workerId?: string;
|
|
268
119
|
readonly timeZone: string;
|
|
269
120
|
}
|
|
270
121
|
interface RivusEndpointDeployment {
|
|
@@ -371,181 +222,114 @@ interface RivusDeploymentRuntimePort {
|
|
|
371
222
|
readonly steer?: (input: AgentRuntimeSteering) => Effect.Effect<boolean, unknown>;
|
|
372
223
|
}
|
|
373
224
|
//#endregion
|
|
374
|
-
//#region src/
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
readonly directory: string;
|
|
379
|
-
readonly envFilePath: string;
|
|
380
|
-
readonly logsDirectory: string;
|
|
381
|
-
readonly manifestPath: string;
|
|
382
|
-
readonly stateDirectory: string;
|
|
383
|
-
readonly workspaceDirectory: string;
|
|
384
|
-
}
|
|
385
|
-
interface InitializedRivusHome {
|
|
386
|
-
readonly directory: string;
|
|
387
|
-
readonly files: ReadonlyArray<string>;
|
|
388
|
-
}
|
|
389
|
-
interface RivusHomeDoctorCheck {
|
|
390
|
-
readonly message: string;
|
|
391
|
-
readonly name: "node" | "home" | "workspace" | "modules" | "manifest" | "credentials";
|
|
392
|
-
readonly status: "pass" | "fail";
|
|
393
|
-
}
|
|
394
|
-
interface RivusHomeDoctorReport {
|
|
395
|
-
readonly checks: ReadonlyArray<RivusHomeDoctorCheck>;
|
|
396
|
-
readonly directory: string;
|
|
397
|
-
readonly ready: boolean;
|
|
225
|
+
//#region src/deployment/application/use-cases/deployment-control.d.ts
|
|
226
|
+
interface RivusDeploymentSuperagentLifecyclePort {
|
|
227
|
+
start(): Effect.Effect<boolean, unknown>;
|
|
228
|
+
stop(): Effect.Effect<void, unknown>;
|
|
398
229
|
}
|
|
399
230
|
//#endregion
|
|
400
|
-
//#region src/
|
|
401
|
-
interface
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
231
|
+
//#region src/cli/lib/recovery/recovery-output.d.ts
|
|
232
|
+
interface DeadLetterRecoveryItem {
|
|
233
|
+
readonly acceptedAt: string;
|
|
234
|
+
readonly attempts: number;
|
|
235
|
+
readonly deliveryId: string;
|
|
236
|
+
readonly endpointId: string;
|
|
237
|
+
readonly failureCode: "delivery_failed";
|
|
238
|
+
readonly failureSummary: string;
|
|
239
|
+
readonly failedAt: string;
|
|
240
|
+
readonly revision: number;
|
|
410
241
|
}
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
readonly
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
readonly
|
|
421
|
-
readonly sender?: {
|
|
422
|
-
readonly sender_id?: {
|
|
423
|
-
readonly open_id?: string;
|
|
424
|
-
};
|
|
425
|
-
readonly sender_type?: string;
|
|
426
|
-
readonly tenant_key?: string;
|
|
427
|
-
};
|
|
428
|
-
readonly message: {
|
|
429
|
-
readonly create_time?: string;
|
|
430
|
-
readonly message_id: string;
|
|
431
|
-
readonly chat_id: string;
|
|
432
|
-
readonly chat_type?: string;
|
|
433
|
-
readonly thread_id?: string;
|
|
434
|
-
readonly parent_id?: string;
|
|
435
|
-
readonly root_id?: string;
|
|
436
|
-
readonly message_type: string;
|
|
437
|
-
readonly mentions?: ReadonlyArray<{
|
|
438
|
-
readonly id?: {
|
|
439
|
-
readonly open_id?: string;
|
|
440
|
-
readonly [key: string]: unknown;
|
|
441
|
-
};
|
|
442
|
-
readonly key?: string;
|
|
443
|
-
readonly name?: string;
|
|
444
|
-
}>;
|
|
445
|
-
readonly content: string;
|
|
446
|
-
};
|
|
447
|
-
};
|
|
242
|
+
interface DeadLetterRequeueResult {
|
|
243
|
+
readonly acceptedAt: string;
|
|
244
|
+
readonly attempts: 0;
|
|
245
|
+
readonly availableAt: string;
|
|
246
|
+
readonly deliveryId: string;
|
|
247
|
+
readonly endpointId: string;
|
|
248
|
+
readonly recoveredAt: string;
|
|
249
|
+
readonly recoveredBy: string;
|
|
250
|
+
readonly revision: number;
|
|
251
|
+
readonly status: "pending";
|
|
448
252
|
}
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
readonly
|
|
453
|
-
|
|
454
|
-
|
|
253
|
+
interface RecoverySnapshot {
|
|
254
|
+
readonly automationOccurrences: ReadonlyArray<AutomationOccurrenceRecoveryItem>;
|
|
255
|
+
readonly deadLetters: ReadonlyArray<DeadLetterRecoveryItem>;
|
|
256
|
+
readonly toolOperations: ReadonlyArray<ToolOperationRecoveryItem>;
|
|
257
|
+
}
|
|
258
|
+
interface ToolOperationRecoveryItem {
|
|
455
259
|
readonly agentId: string;
|
|
260
|
+
readonly inputDigest: string;
|
|
261
|
+
readonly instanceId: string;
|
|
262
|
+
readonly operationId: string;
|
|
263
|
+
readonly failureCode: "tool_outcome_unknown";
|
|
264
|
+
readonly failureSummary: string;
|
|
265
|
+
readonly revision: number;
|
|
266
|
+
readonly status: "reconciliation-required";
|
|
267
|
+
readonly toolId: string;
|
|
268
|
+
readonly toolVersion: string;
|
|
456
269
|
}
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
readonly
|
|
462
|
-
readonly
|
|
463
|
-
readonly
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
readonly
|
|
467
|
-
readonly
|
|
468
|
-
}
|
|
469
|
-
interface FeishuNewSessionMessageIntakeSummary extends FeishuMessageIntakeBaseSummary {
|
|
470
|
-
readonly commandType: "new_session";
|
|
471
|
-
readonly previousSessionKey: SessionKey;
|
|
472
|
-
}
|
|
473
|
-
interface FeishuCancelMessageIntakeSummary extends FeishuMessageIntakeBaseSummary {
|
|
474
|
-
readonly commandType: "cancel_run";
|
|
475
|
-
readonly reason: string;
|
|
476
|
-
readonly runId?: AgentRunId;
|
|
270
|
+
interface ToolOperationResolutionResult {
|
|
271
|
+
readonly agentId: string;
|
|
272
|
+
readonly inputDigest: string;
|
|
273
|
+
readonly instanceId: string;
|
|
274
|
+
readonly operationId: string;
|
|
275
|
+
readonly reconciledAt: string;
|
|
276
|
+
readonly reconciledBy: string;
|
|
277
|
+
readonly revision: number;
|
|
278
|
+
readonly status: "aborted" | "completed";
|
|
279
|
+
readonly toolId: string;
|
|
280
|
+
readonly toolVersion: string;
|
|
477
281
|
}
|
|
478
282
|
//#endregion
|
|
479
|
-
//#region src/
|
|
480
|
-
interface
|
|
481
|
-
readonly
|
|
482
|
-
readonly
|
|
483
|
-
readonly
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
readonly
|
|
487
|
-
readonly
|
|
488
|
-
readonly
|
|
489
|
-
|
|
490
|
-
interface FeishuAgentDaemonCancelResult {
|
|
491
|
-
readonly cancelled: boolean;
|
|
492
|
-
readonly messageId: string;
|
|
493
|
-
readonly runId?: AgentRunId;
|
|
494
|
-
readonly reason?: "not_active";
|
|
495
|
-
}
|
|
496
|
-
interface FeishuAgentDaemonSteeredResult {
|
|
497
|
-
readonly messageId: string;
|
|
498
|
-
readonly runId: AgentRunId;
|
|
499
|
-
readonly steered: true;
|
|
500
|
-
}
|
|
501
|
-
interface FeishuAgentDaemonInteractionResult {
|
|
502
|
-
readonly interaction: HumanInteractionSnapshot;
|
|
503
|
-
readonly interactionId: string;
|
|
504
|
-
readonly messageId: string;
|
|
505
|
-
readonly resolved: true;
|
|
506
|
-
}
|
|
507
|
-
interface FeishuAgentDaemonSessionResetResult {
|
|
508
|
-
readonly messageId: string;
|
|
509
|
-
readonly previousSessionKey: SessionKey;
|
|
510
|
-
readonly sessionKey: SessionKey;
|
|
511
|
-
readonly reset: true;
|
|
512
|
-
}
|
|
513
|
-
type FeishuAgentDaemonHandleResult = FeishuAgentDaemonRunResult | FeishuAgentDaemonSkippedResult | FeishuAgentDaemonCancelResult | FeishuAgentDaemonSteeredResult | FeishuAgentDaemonInteractionResult | FeishuAgentDaemonSessionResetResult;
|
|
514
|
-
type FeishuAgentMessageSideEffects = "enabled" | "disabled";
|
|
515
|
-
interface FeishuAgentDaemonHandleMessageOptions {
|
|
516
|
-
readonly sideEffects?: FeishuAgentMessageSideEffects;
|
|
283
|
+
//#region src/upgrade/application/use-cases/run-upgrade.d.ts
|
|
284
|
+
interface UpgradeResult {
|
|
285
|
+
readonly status: "upgraded" | "current";
|
|
286
|
+
readonly version: string;
|
|
287
|
+
readonly previousVersion: string;
|
|
288
|
+
readonly home: string;
|
|
289
|
+
readonly service: string;
|
|
290
|
+
readonly pid: number;
|
|
291
|
+
readonly executable: string;
|
|
292
|
+
readonly backup?: string;
|
|
293
|
+
readonly operationId?: string;
|
|
517
294
|
}
|
|
518
295
|
//#endregion
|
|
519
|
-
//#region src/
|
|
520
|
-
type
|
|
521
|
-
readonly
|
|
522
|
-
readonly
|
|
523
|
-
readonly pending: number;
|
|
296
|
+
//#region src/bootstrap/cli/recovery-command.d.ts
|
|
297
|
+
type RecoveryToolOperationOutcome = {
|
|
298
|
+
readonly result: unknown;
|
|
299
|
+
readonly status: "applied";
|
|
524
300
|
} | {
|
|
525
|
-
readonly
|
|
526
|
-
readonly messageId: string;
|
|
527
|
-
readonly pending: number;
|
|
528
|
-
readonly reason: "capacity" | "duplicate" | "ignored";
|
|
301
|
+
readonly status: "not-applied";
|
|
529
302
|
};
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
readonly
|
|
534
|
-
readonly
|
|
535
|
-
readonly
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
303
|
+
/** Operator recovery over the owners found in one deployment's state directory. */
|
|
304
|
+
interface RecoveryControl {
|
|
305
|
+
grantAutomationAttempt(input: {
|
|
306
|
+
readonly actorId: string;
|
|
307
|
+
readonly automationId: string;
|
|
308
|
+
readonly expectedRevision: number;
|
|
309
|
+
readonly note: string;
|
|
310
|
+
readonly occurrence: string;
|
|
311
|
+
}): Effect.Effect<AutomationAttemptGrantResult, unknown>;
|
|
312
|
+
inspect(): Effect.Effect<RecoverySnapshot, unknown>;
|
|
313
|
+
requeueDeadLetter(input: {
|
|
314
|
+
readonly actorId: string;
|
|
315
|
+
readonly deliveryId: string;
|
|
316
|
+
readonly endpointId: string;
|
|
317
|
+
readonly expectedRevision: number;
|
|
318
|
+
readonly note: string;
|
|
319
|
+
}): Effect.Effect<DeadLetterRequeueResult, unknown>;
|
|
320
|
+
resolveToolOperation(input: {
|
|
321
|
+
readonly actorId: string;
|
|
322
|
+
readonly expectedRevision: number;
|
|
323
|
+
readonly instanceId: string;
|
|
324
|
+
readonly note: string;
|
|
325
|
+
readonly operationId: string;
|
|
326
|
+
readonly outcome: RecoveryToolOperationOutcome;
|
|
327
|
+
}): Effect.Effect<ToolOperationResolutionResult, unknown>;
|
|
545
328
|
}
|
|
546
329
|
//#endregion
|
|
547
330
|
//#region src/bootstrap/deployment/rivus-deployment-cli-process.d.ts
|
|
548
331
|
interface RivusDeploymentBootstrapAdapters {
|
|
332
|
+
readonly superagent?: RivusDeploymentSuperagentLifecyclePort;
|
|
549
333
|
readonly initialInstanceRecords?: ReadonlyArray<AgentInstanceRecord>;
|
|
550
334
|
readonly dispose?: () => Promise<void> | void;
|
|
551
335
|
readonly createAutomation?: RivusDeploymentAutomationFactoryPort["create"];
|
|
@@ -553,7 +337,6 @@ interface RivusDeploymentBootstrapAdapters {
|
|
|
553
337
|
readonly createRecoveryControl?: () => Effect.Effect<RecoveryControl, unknown>;
|
|
554
338
|
readonly createRuntime: RivusDeploymentRuntimeFactoryPort["create"];
|
|
555
339
|
readonly createEndpoint: RivusDeploymentEndpointFactoryPort["create"];
|
|
556
|
-
readonly replayReceiveMessage?: (handleDefault: (input: AgentRuntimeInput) => Effect.Effect<unknown, unknown>, payload: FeishuReceiveMessagePayload, options?: FeishuReceiveMessageReplayOptions) => Effect.Effect<FeishuReceiveMessageReplayResult, unknown>;
|
|
557
340
|
}
|
|
558
341
|
interface RivusDeploymentBootstrapContext {
|
|
559
342
|
readonly argv: ReadonlyArray<string>;
|
|
@@ -567,5 +350,5 @@ interface RivusDeploymentBootstrapContext {
|
|
|
567
350
|
}
|
|
568
351
|
type RivusDeploymentBootstrapFactory = (context: RivusDeploymentBootstrapContext) => Promise<RivusDeploymentBootstrapAdapters> | RivusDeploymentBootstrapAdapters;
|
|
569
352
|
//#endregion
|
|
570
|
-
export {
|
|
353
|
+
export { CreateRivusDeploymentAutomationPortInput as a, CreateRivusDeploymentRuntimePortInput as c, RivusDeploymentRuntimePort as d, RivusDaemonEnv as f, UpgradeResult as i, RivusDeploymentBackgroundSessionPort as l, RivusHome as m, RivusDeploymentBootstrapFactory as n, CreateRivusDeploymentBackgroundSessionPortInput as o, RivusHomeApi as p, RecoveryControl as r, CreateRivusDeploymentEndpointPortInput as s, RivusDeploymentBootstrapContext as t, RivusDeploymentEndpointPort as u };
|
|
571
354
|
export {};
|