@rivus/gateway 0.21.1 → 0.22.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.
Files changed (31) hide show
  1. package/README.md +4 -1
  2. package/assets/audio-transcriber/fetch-model.mjs +63 -70
  3. package/assets/audio-transcriber/transcribe.mjs +38 -47
  4. package/assets/installation-policy.json +4 -3
  5. package/dist/bootstrap/feishu.d.ts +7 -2
  6. package/dist/bootstrap/feishu.js +19195 -17153
  7. package/dist/bootstrap/herdr-feishu.d.ts +1 -7
  8. package/dist/bootstrap/herdr-feishu.js +23 -12
  9. package/dist/chunks/automation-presentation.js +58 -60
  10. package/dist/chunks/feishu-receive-message.js +113 -0
  11. package/dist/chunks/herdr-feishu-runtime.js +1027 -642
  12. package/dist/chunks/public.d.ts +278 -0
  13. package/dist/chunks/public2.d.ts +10 -0
  14. package/dist/chunks/rivus-deployment-cli-process.d.ts +127 -455
  15. package/dist/chunks/rivus-home-deployment-env.js +1342 -1781
  16. package/dist/chunks/rivus-node-entrypoint.js +4351 -4061
  17. package/dist/index.d.ts +23 -11
  18. package/dist/mcp.d.ts +10 -9
  19. package/dist/mcp.js +43 -43
  20. package/package.json +15 -11
  21. package/templates/a-share-briefing-analysis.mjs +32 -34
  22. package/templates/a-share-briefing-renderer.mjs +175 -186
  23. package/templates/a-share-index-evidence.mjs +50 -54
  24. package/templates/a-share-market-briefing.mjs +37 -39
  25. package/templates/a-share-overseas-evidence.mjs +35 -39
  26. package/templates/a-share-policy-evidence.mjs +90 -96
  27. package/templates/a-share-sector-evidence.mjs +32 -35
  28. package/templates/acp-stdio-proxy.mjs +21 -22
  29. package/templates/current-weather.mjs +56 -58
  30. package/templates/html-drive-tools.mjs +130 -141
  31. package/templates/rivus-agents.plugin.mjs +55 -57
@@ -1,6 +1,10 @@
1
- import { Effect, Schema } from "effect";
2
- import { AgentInvocationOrigin, AgentRunId, AgentRunUpdate, AttachmentAccess, RegisteredRivusSkill, RegisteredRivusTool, RivusMemoryScope, RivusResolvedToolDescriptor, RivusRuntimeToolGrantSet, RivusRuntimeToolId, RivusSkillDescriptor, RivusSkillGrantSet, RivusToolDescriptor, RivusToolGrantSet, SessionKey, UserInput } from "@rivus/runtime";
3
- //#region src/core/application/recovery/contracts/recovery-control.d.ts
1
+ import { i as RegisteredRivusAutomation, m as ResolvedRivusAgentDefinition, n as AgentRuntimeInput, r as AgentRuntimeSteering, t as AgentRuntimeCancellation, u as RivusPluginCatalog, y as ScheduledAutomationRunInput } from "./public.js";
2
+ import "./public2.js";
3
+ import { Context, Effect, Layer, Schema } from "effect";
4
+ import { AgentInvocationOrigin, AgentRunId, AgentRunUpdate, AttachmentAccess, SessionKey, UserInput } from "@rivus/runtime";
5
+ import "@rivus/platform/concurrency";
6
+ import { Client } from "@larksuiteoapi/node-sdk";
7
+ //#region src/recovery/application/services/recovery-contracts.d.ts
4
8
  type RecoveryToolOperationOutcome = {
5
9
  readonly result: unknown;
6
10
  readonly status: "applied";
@@ -103,313 +107,97 @@ interface RecoveryControl {
103
107
  }): Effect.Effect<ToolOperationResolutionResult, unknown>;
104
108
  }
105
109
  //#endregion
106
- //#region src/core/domain/automation-occurrence/aggregate/snapshot.d.ts
107
- type AutomationOccurrenceStatus = "running" | "failed" | "generated" | "suppressed" | "delivered" | "stopped";
108
- interface AutomationOccurrenceStop {
109
- readonly reason: "attempt-limit" | "terminal-failure";
110
- readonly code?: string;
111
- }
112
- interface AutomationOccurrenceRecovery {
113
- readonly actorId: string;
114
- readonly at: string;
115
- readonly note: string;
116
- readonly attemptLimit: number;
117
- }
118
- interface AutomationOccurrenceSnapshot {
119
- readonly attempts: number;
120
- readonly attemptLimit: number | null;
121
- readonly automationId: string;
122
- readonly body?: string;
123
- readonly error?: string;
124
- readonly mandateId: string;
125
- readonly occurrence: string;
126
- readonly presentation?: unknown;
127
- readonly providerMessageId?: string;
128
- readonly recoveries: ReadonlyArray<AutomationOccurrenceRecovery>;
129
- readonly revision: number;
130
- readonly runId?: string;
131
- readonly status: AutomationOccurrenceStatus;
132
- readonly stop?: AutomationOccurrenceStop;
133
- readonly suppressionReason?: string;
134
- readonly tickId: string;
110
+ //#region src/human-interaction/domain/human-interaction/aggregates/snapshot.d.ts
111
+ type HumanInteractionId = string;
112
+ type HumanInteractionToolRisk = "observe" | "mutate" | "irreversible" | "host-control";
113
+ interface HumanInteractionActor {
114
+ readonly openId: string;
115
+ readonly tenantKey: string;
135
116
  }
136
- //#endregion
137
- //#region src/core/domain/automation-occurrence/aggregate/automation-occurrence.d.ts
138
- interface CreateAutomationOccurrenceInput {
139
- readonly attemptLimit?: number | null;
140
- readonly automationId: string;
141
- readonly mandateId: string;
142
- readonly occurrence: string;
143
- readonly tickId: string;
117
+ interface HumanInteractionFact {
118
+ readonly label: string;
119
+ readonly value: string;
144
120
  }
145
- interface GenerateAutomationOccurrenceInput {
146
- readonly body: string;
147
- readonly presentation?: unknown;
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;
148
128
  readonly runId: string;
129
+ readonly sessionKey: string;
130
+ readonly tenantKey: string;
131
+ readonly toolId: string;
132
+ readonly toolVersion: string;
149
133
  }
150
- interface SuppressAutomationOccurrenceInput {
151
- readonly reason: string;
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;
152
143
  readonly runId: string;
153
- }
154
- interface StopAutomationOccurrenceInput extends AutomationOccurrenceStop {
155
- readonly error: string;
156
- }
157
- interface GrantAutomationOccurrenceAttemptInput {
158
- readonly actorId: string;
159
- readonly at: string;
160
- readonly note: string;
161
- }
162
- declare class AutomationOccurrence {
163
- #private;
164
- private constructor();
165
- static create(input: CreateAutomationOccurrenceInput): AutomationOccurrence;
166
- static restore(value: unknown): AutomationOccurrence;
167
- get attempts(): number;
168
- get attemptLimit(): number | null;
169
- get automationId(): string;
170
- get mandateId(): string;
171
- get occurrence(): string;
172
- get recoveries(): ReadonlyArray<AutomationOccurrenceRecovery>;
173
- get revision(): number;
174
- get status(): AutomationOccurrenceStatus;
175
- get tickId(): string;
176
- restart(): AutomationOccurrence;
177
- reserveDelivery(): AutomationOccurrence;
178
- fail(error: string): AutomationOccurrence;
179
- stop(input: StopAutomationOccurrenceInput): AutomationOccurrence;
180
- grantAttempt(input: GrantAutomationOccurrenceAttemptInput): AutomationOccurrence;
181
- generate(input: GenerateAutomationOccurrenceInput): AutomationOccurrence;
182
- suppress(input: SuppressAutomationOccurrenceInput): AutomationOccurrence;
183
- deliver(providerMessageId: string): AutomationOccurrence;
184
- validateTransitionTo(next: AutomationOccurrence): boolean;
185
- toSnapshot(): AutomationOccurrenceSnapshot;
186
- private requireRunning;
187
- private requireGenerated;
188
- private requireAttemptAvailable;
189
- private generatedFields;
190
- private next;
191
- }
192
- //#endregion
193
- //#region src/core/application/automation/presentation/automation-line-chart.d.ts
194
- interface AutomationLineChart {
195
- readonly title: string;
196
- readonly labels: ReadonlyArray<string>;
197
- readonly unit: string;
198
- readonly seriesLayout?: "overlay" | "separate";
199
- readonly series: ReadonlyArray<{
200
- readonly name: string;
201
- readonly values: ReadonlyArray<number>;
202
- }>;
203
- }
204
- //#endregion
205
- //#region src/core/application/automation/presentation/automation-presentation.d.ts
206
- declare const AUTOMATION_PRESENTATION_SCHEMA_VERSION: 2;
207
- type AutomationPresentationKind = "daily-ai" | "generic" | "industry" | "news" | "subscriptions";
208
- type AutomationPresentationTrend = "up" | "down" | "flat";
209
- interface AutomationPresentationSource {
210
- readonly label: string;
211
- readonly url: string;
212
- }
213
- interface AutomationPresentationTableCell {
214
- readonly text: string;
215
- readonly trend?: AutomationPresentationTrend;
216
- }
217
- interface AutomationPresentationTableColumn {
218
- readonly label: string;
219
- readonly align?: "left" | "center" | "right";
220
- readonly width?: number;
221
- }
222
- interface AutomationPresentationTable {
223
- readonly columns: ReadonlyArray<AutomationPresentationTableColumn>;
224
- readonly rows: ReadonlyArray<ReadonlyArray<AutomationPresentationTableCell>>;
225
- }
226
- interface AutomationPresentationItem {
227
- readonly emphasis?: "accent";
228
- readonly headline: string;
229
- readonly note?: string;
230
- readonly sources: ReadonlyArray<AutomationPresentationSource>;
231
- }
232
- interface AutomationPresentationSection {
233
- readonly collapsed?: boolean;
234
- readonly id: string;
235
- readonly items: ReadonlyArray<AutomationPresentationItem>;
236
- readonly lineChart?: AutomationLineChart;
237
- readonly listStyle?: "bullet" | "numbered" | "plain";
238
- readonly style?: "plain" | "highlight";
239
- readonly table?: AutomationPresentationTable;
240
- readonly title: string;
241
- }
242
- interface AutomationPresentation {
243
- readonly footer?: string;
244
- readonly lineChart?: AutomationLineChart;
245
- readonly footnote?: string;
246
- readonly kind?: AutomationPresentationKind;
247
- readonly meta: ReadonlyArray<string>;
248
- readonly schemaVersion: typeof AUTOMATION_PRESENTATION_SCHEMA_VERSION;
249
- readonly sectionDividers?: boolean;
250
- readonly sections: ReadonlyArray<AutomationPresentationSection>;
251
- readonly subtitle?: string;
252
- readonly summary?: string;
253
- readonly summaryStyle?: "plain" | "highlight";
144
+ readonly sessionKey: string;
145
+ readonly sourceMessageId: string;
146
+ readonly summary: string;
147
+ readonly tenantKey: string;
254
148
  readonly title: string;
255
- readonly trendColors?: "red-up" | "green-up";
256
- }
257
- declare function readAutomationPresentation(value: unknown): AutomationPresentation;
258
- //#endregion
259
- //#region src/core/application/agent-catalog/contracts/rivus-automation-template.d.ts
260
- interface RivusAutomationRetryPolicy {
261
- readonly maxAttempts: number;
262
- readonly terminalFailureCodes?: ReadonlyArray<string>;
263
- }
264
- declare class RivusAutomationFailure extends Error {
265
- readonly name = "RivusAutomationFailure";
266
- readonly code: string;
267
- constructor(code: string, message?: string, options?: ErrorOptions);
268
- }
269
- interface RivusAutomationTemplate {
270
- readonly id: string;
271
- readonly profileId: string;
272
- readonly requestedSkillIds: ReadonlyArray<string>;
273
- readonly requestedToolIds: ReadonlyArray<string>;
274
- readonly retry?: RivusAutomationRetryPolicy;
275
- readonly createInput: (tick: RivusAutomationTickContext) => RivusAutomationInput;
276
- readonly createPresentation?: (output: RivusAutomationOutput) => AutomationPresentation;
277
- }
278
- interface RivusAutomationTickContext {
279
- readonly occurrence: string;
280
149
  }
281
- interface RivusAutomationInput {
282
- readonly text: string;
283
- }
284
- interface RivusAutomationOutput {
285
- readonly occurrence: string;
286
- readonly text: string;
287
- }
288
- interface RegisteredRivusAutomation extends RivusAutomationTemplate {
289
- readonly pluginId: string;
150
+ interface PendingHumanInteractionState {
151
+ readonly status: "pending";
290
152
  }
291
- //#endregion
292
- //#region src/core/application/automation/scheduling/automation-scheduler.d.ts
293
- interface ScheduledAutomationRunInput {
294
- readonly occurrence: string;
295
- readonly sessionKey: string;
296
- readonly text: string;
297
- readonly tickId: string;
153
+ interface ApprovedHumanInteractionState {
154
+ readonly actor: HumanInteractionActor;
155
+ readonly consumedAt?: string;
156
+ readonly resolvedAt: string;
157
+ readonly status: "approved";
298
158
  }
299
- interface AutomationScheduler {
300
- running(): boolean;
301
- runDue(at: Date): Effect.Effect<AutomationOccurrence | undefined, unknown>;
302
- start(): Effect.Effect<void>;
303
- stop(): Effect.Effect<void>;
159
+ interface RejectedHumanInteractionState {
160
+ readonly actor: HumanInteractionActor;
161
+ readonly resolvedAt: string;
162
+ readonly status: "rejected";
304
163
  }
305
- //#endregion
306
- //#region src/core/application/agent-catalog/contracts/rivus-agent-definition.d.ts
307
- interface RivusAgentProfile {
308
- readonly id: string;
309
- readonly displayName: string;
310
- readonly systemPrompt: string;
311
- readonly model: Readonly<Record<string, unknown>>;
312
- readonly tools: {
313
- readonly allow: ReadonlyArray<string>;
314
- };
315
- readonly skills: {
316
- readonly allow: ReadonlyArray<string>;
317
- };
318
- readonly memory: {
319
- readonly scopes: ReadonlyArray<RivusMemoryScope>;
320
- };
321
- readonly runtimeTools?: {
322
- readonly allow: ReadonlyArray<RivusRuntimeToolId>;
323
- };
164
+ interface SelectedHumanInteractionState {
165
+ readonly actor: HumanInteractionActor;
166
+ readonly optionId: string;
167
+ readonly resolvedAt: string;
168
+ readonly status: "selected";
324
169
  }
325
- interface RegisteredRivusAgentProfile extends RivusAgentProfile {
326
- readonly pluginId: string;
170
+ interface ExpiredHumanInteractionState {
171
+ readonly expiredAt: string;
172
+ readonly status: "expired";
327
173
  }
328
- interface RivusAgentDeployment {
329
- readonly agentId: string;
330
- readonly pluginId: string;
331
- readonly profileId: string;
332
- readonly projectSpaceId?: string;
333
- readonly endpointIds: ReadonlyArray<string>;
334
- readonly memory?: {
335
- readonly scopes: ReadonlyArray<RivusMemoryScope>;
336
- readonly tool: boolean;
337
- };
338
- readonly runtime?: {
339
- readonly type: "acp";
340
- readonly command: string;
341
- readonly args?: ReadonlyArray<string>;
342
- readonly env?: Readonly<Record<string, string>>;
343
- readonly permissions?: "ask" | "deny";
344
- readonly steering?: "disabled" | "cancel-and-reprompt";
345
- readonly unattended?: boolean;
346
- readonly initializationTimeoutMs?: number;
347
- };
348
- readonly runtimeTools?: {
349
- readonly allow: ReadonlyArray<RivusRuntimeToolId>;
350
- };
351
- readonly skills: {
352
- readonly allow: ReadonlyArray<string>;
353
- };
354
- readonly tools: {
355
- readonly allow: ReadonlyArray<string>;
356
- };
174
+ interface CancelledHumanInteractionState {
175
+ readonly cancelledAt: string;
176
+ readonly reason?: string;
177
+ readonly status: "cancelled";
357
178
  }
358
- interface ResolvedRivusAgentDefinition {
359
- readonly agentId: string;
360
- readonly pluginId: string;
361
- readonly profileId: string;
362
- readonly projectSpaceId?: string;
363
- readonly projectSpaceRevision?: string;
364
- readonly endpointIds: ReadonlyArray<string>;
365
- readonly profileRevision: string;
366
- readonly systemPrompt: string;
367
- readonly model: Readonly<Record<string, unknown>>;
368
- readonly memory: {
369
- readonly scopes: ReadonlyArray<RivusMemoryScope>;
370
- readonly tool: boolean;
371
- };
372
- readonly runtime?: Required<NonNullable<RivusAgentDeployment["runtime"]>>;
373
- readonly runtimeToolGrantSet: RivusRuntimeToolGrantSet;
374
- readonly skillGrantSet: RivusSkillGrantSet;
375
- readonly skills: ReadonlyArray<RegisteredRivusSkill>;
376
- readonly tools: ReadonlyArray<RivusResolvedToolDescriptor>;
377
- readonly toolGrantSet: RivusToolGrantSet;
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;
378
184
  }
379
- //#endregion
380
- //#region src/core/application/agent-catalog/contracts/rivus-plugin.d.ts
381
- declare const RIVUS_PLUGIN_API_VERSION = "1";
382
- interface RivusPluginManifest {
383
- readonly apiVersion: string;
185
+ interface UserDecisionOption {
186
+ readonly description: string;
384
187
  readonly id: string;
385
- readonly version: string;
188
+ readonly label: string;
386
189
  }
387
- interface RegisteredRivusPlugin extends RivusPluginManifest {}
388
- //#endregion
389
- //#region src/core/application/agent-catalog/contracts/rivus-plugin-contracts.d.ts
390
- interface RivusPluginRegistry {
391
- registerAgentProfile(profile: RivusAgentProfile): void;
392
- registerTool(tool: RivusToolDescriptor): void;
393
- registerSkill(skill: RivusSkillDescriptor): void;
394
- registerAutomation(template: RivusAutomationTemplate): void;
395
- }
396
- interface RivusPlugin {
397
- readonly manifest: RivusPluginManifest;
398
- register(registry: RivusPluginRegistry): void;
399
- }
400
- interface RivusPluginCatalogSnapshot {
401
- readonly plugins: ReadonlyArray<RegisteredRivusPlugin>;
402
- readonly profiles: ReadonlyArray<RegisteredRivusAgentProfile>;
403
- readonly tools: ReadonlyArray<RegisteredRivusTool>;
404
- readonly skills: ReadonlyArray<RegisteredRivusSkill>;
405
- readonly automations: ReadonlyArray<RegisteredRivusAutomation>;
406
- }
407
- interface RivusPluginCatalog {
408
- registerPlugin(plugin: RivusPlugin): void;
409
- snapshot(): RivusPluginCatalogSnapshot;
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;
410
196
  }
197
+ type HumanInteraction = ToolApprovalInteraction | UserDecisionInteraction;
198
+ type HumanInteractionSnapshot = HumanInteraction;
411
199
  //#endregion
412
- //#region src/core/application/agent-host/contracts/agent-instance.d.ts
200
+ //#region src/agent-host/domain/instance/value-objects/agent-instance.d.ts
413
201
  type AgentInstanceBinding = {
414
202
  readonly kind: "endpoint";
415
203
  readonly endpointId: string;
@@ -428,38 +216,10 @@ interface AgentInstanceRecord {
428
216
  readonly runtimeGenerationId: string;
429
217
  }
430
218
  //#endregion
431
- //#region src/core/application/agent-host/contracts/agent-host-runtime.d.ts
432
- interface AgentRuntimeInput {
433
- readonly attachmentAccess?: AttachmentAccess;
434
- readonly invocation?: AgentInvocationOrigin;
435
- readonly onUpdate?: (update: AgentRunUpdate) => Effect.Effect<void, unknown>;
436
- readonly payload?: unknown;
437
- readonly sessionKey: SessionKey;
438
- readonly text: string;
439
- readonly userInput?: UserInput;
440
- }
441
- interface AgentRuntimeCancellation {
442
- readonly reason?: string;
443
- readonly runId: AgentRunId;
444
- readonly sessionKey: SessionKey;
445
- }
446
- interface AgentRuntimeSteering {
447
- readonly attachmentAccess?: AttachmentAccess;
448
- readonly runId: AgentRunId;
449
- readonly sessionKey: SessionKey;
450
- readonly text: string;
451
- readonly userInput?: UserInput;
452
- }
453
- //#endregion
454
- //#region src/core/application/agent-host/registry/agent-instance-registry.d.ts
455
- interface AgentInstanceRegistryOptions {
456
- readonly initialRecords?: ReadonlyArray<AgentInstanceRecord>;
457
- }
458
- //#endregion
459
- //#region src/core/domain/background-session/value-objects/phase.d.ts
219
+ //#region src/background-session/domain/background-session/value-objects/phase.d.ts
460
220
  type BackgroundSessionPhase = "queued" | "running" | "waiting" | "input-required" | "stopping" | "stopped" | "completed" | "failed" | "reconciliation-required";
461
221
  //#endregion
462
- //#region src/core/application/background-session/supervision/background-session-supervisor.d.ts
222
+ //#region src/background-session/application/use-cases/background-session-supervisor.d.ts
463
223
  interface BackgroundSessionSupervisorStatus {
464
224
  readonly capacity: number;
465
225
  readonly counters: {
@@ -479,7 +239,7 @@ interface BackgroundSessionSupervisorStatus {
479
239
  readonly running: boolean;
480
240
  }
481
241
  //#endregion
482
- //#region src/core/application/deployment/contracts/manifest.d.ts
242
+ //#region src/deployment/domain/manifest/value-objects/manifest.d.ts
483
243
  interface RivusBackgroundSessionsDeployment {
484
244
  readonly enabled: boolean;
485
245
  readonly leaseMs: number;
@@ -526,7 +286,7 @@ interface RivusEndpointExperimentalFeatures {
526
286
  readonly cotMessages: boolean;
527
287
  }
528
288
  //#endregion
529
- //#region src/core/application/deployment/contracts/deployment.d.ts
289
+ //#region src/deployment/application/ports.d.ts
530
290
  interface ResolvedRivusAutomationDefinition extends RivusAutomationDeployment {
531
291
  readonly runtimeDefinition: ResolvedRivusAgentDefinition;
532
292
  readonly template: RegisteredRivusAutomation;
@@ -611,97 +371,48 @@ interface RivusDeploymentRuntimePort {
611
371
  readonly steer?: (input: AgentRuntimeSteering) => Effect.Effect<boolean, unknown>;
612
372
  }
613
373
  //#endregion
614
- //#region src/core/domain/human-interaction/aggregate/snapshot.d.ts
615
- type HumanInteractionId = string;
616
- type HumanInteractionToolRisk = "observe" | "mutate" | "irreversible" | "host-control";
617
- interface HumanInteractionActor {
618
- readonly openId: string;
619
- readonly tenantKey: string;
620
- }
621
- interface HumanInteractionFact {
622
- readonly label: string;
623
- readonly value: string;
624
- }
625
- interface ToolApprovalBinding {
626
- readonly agentId: string;
627
- readonly callId: string;
628
- readonly inputDigest: string;
629
- readonly instanceId: string;
630
- readonly operationId: string;
631
- readonly risk: HumanInteractionToolRisk;
632
- readonly runId: string;
633
- readonly sessionKey: string;
634
- readonly tenantKey: string;
635
- readonly toolId: string;
636
- readonly toolVersion: string;
637
- }
638
- interface HumanInteractionBase {
639
- readonly agentId: string;
640
- readonly allowedActorOpenIds: ReadonlyArray<string>;
641
- readonly createdAt: string;
642
- readonly expiresAt: string;
643
- readonly facts: ReadonlyArray<HumanInteractionFact>;
644
- readonly id: HumanInteractionId;
645
- readonly instanceId: string;
646
- readonly revision: number;
647
- readonly runId: string;
648
- readonly sessionKey: string;
649
- readonly sourceMessageId: string;
650
- readonly summary: string;
651
- readonly tenantKey: string;
652
- readonly title: string;
653
- }
654
- interface PendingHumanInteractionState {
655
- readonly status: "pending";
656
- }
657
- interface ApprovedHumanInteractionState {
658
- readonly actor: HumanInteractionActor;
659
- readonly consumedAt?: string;
660
- readonly resolvedAt: string;
661
- readonly status: "approved";
662
- }
663
- interface RejectedHumanInteractionState {
664
- readonly actor: HumanInteractionActor;
665
- readonly resolvedAt: string;
666
- readonly status: "rejected";
667
- }
668
- interface SelectedHumanInteractionState {
669
- readonly actor: HumanInteractionActor;
670
- readonly optionId: string;
671
- readonly resolvedAt: string;
672
- readonly status: "selected";
673
- }
674
- interface ExpiredHumanInteractionState {
675
- readonly expiredAt: string;
676
- readonly status: "expired";
374
+ //#region src/home/domain/home/value-objects/rivus-home.d.ts
375
+ type RivusHomeEnvironment = Readonly<Record<string, string | undefined>>;
376
+ interface RivusHome {
377
+ readonly bootstrap: string;
378
+ readonly directory: string;
379
+ readonly envFilePath: string;
380
+ readonly logsDirectory: string;
381
+ readonly manifestPath: string;
382
+ readonly stateDirectory: string;
383
+ readonly workspaceDirectory: string;
677
384
  }
678
- interface CancelledHumanInteractionState {
679
- readonly cancelledAt: string;
680
- readonly reason?: string;
681
- readonly status: "cancelled";
385
+ interface InitializedRivusHome {
386
+ readonly directory: string;
387
+ readonly files: ReadonlyArray<string>;
682
388
  }
683
- type ToolApprovalInteractionState = PendingHumanInteractionState | ApprovedHumanInteractionState | RejectedHumanInteractionState | ExpiredHumanInteractionState | CancelledHumanInteractionState;
684
- interface ToolApprovalInteraction extends HumanInteractionBase {
685
- readonly kind: "tool-approval";
686
- readonly request: Omit<ToolApprovalBinding, "agentId" | "instanceId" | "runId" | "sessionKey" | "tenantKey">;
687
- readonly state: ToolApprovalInteractionState;
389
+ interface RivusHomeDoctorCheck {
390
+ readonly message: string;
391
+ readonly name: "node" | "home" | "workspace" | "modules" | "manifest" | "credentials";
392
+ readonly status: "pass" | "fail";
688
393
  }
689
- interface UserDecisionOption {
690
- readonly description: string;
691
- readonly id: string;
692
- readonly label: string;
394
+ interface RivusHomeDoctorReport {
395
+ readonly checks: ReadonlyArray<RivusHomeDoctorCheck>;
396
+ readonly directory: string;
397
+ readonly ready: boolean;
693
398
  }
694
- type UserDecisionInteractionState = PendingHumanInteractionState | SelectedHumanInteractionState | RejectedHumanInteractionState | ExpiredHumanInteractionState | CancelledHumanInteractionState;
695
- interface UserDecisionInteraction extends HumanInteractionBase {
696
- readonly kind: "user-decision";
697
- readonly options: ReadonlyArray<UserDecisionOption>;
698
- readonly recommendedOptionId?: string;
699
- readonly state: UserDecisionInteractionState;
399
+ //#endregion
400
+ //#region src/home/application/ports.d.ts
401
+ interface RivusHomeApi {
402
+ diagnose(input: {
403
+ readonly directory: string;
404
+ readonly env: RivusHomeEnvironment;
405
+ readonly envFilePath?: string;
406
+ readonly nodeVersion: string;
407
+ }): Effect.Effect<RivusHomeDoctorReport, Error>;
408
+ load(directory: string): Effect.Effect<RivusHome, Error>;
409
+ setup(directory: string): Effect.Effect<InitializedRivusHome, Error>;
700
410
  }
701
- type HumanInteraction = ToolApprovalInteraction | UserDecisionInteraction;
702
- type HumanInteractionSnapshot = HumanInteraction;
703
411
  //#endregion
704
- //#region src/adapters/feishu/protocol/feishu-receive-message.d.ts
412
+ //#region src/home/infra/adapters/config/rivus-daemon-config.d.ts
413
+ type RivusDaemonEnv = Readonly<Record<string, string | undefined>>;
414
+ //#endregion
415
+ //#region src/feishu/domain/message/adapters/feishu-receive-message.d.ts
705
416
  interface FeishuReceiveMessagePayload {
706
417
  readonly header?: {
707
418
  readonly tenant_key?: string;
@@ -733,7 +444,7 @@ interface FeishuReceiveMessagePayload {
733
444
  };
734
445
  }
735
446
  //#endregion
736
- //#region src/adapters/feishu/conversation-session/feishu-session-key.d.ts
447
+ //#region src/feishu/infra/adapters/conversation-session/feishu-session-key.d.ts
737
448
  interface FeishuSessionReference {
738
449
  readonly tenantKey: string;
739
450
  readonly chatId: string;
@@ -741,7 +452,7 @@ interface FeishuSessionReference {
741
452
  readonly agentId: string;
742
453
  }
743
454
  //#endregion
744
- //#region src/adapters/feishu/intake/feishu-message-intake.d.ts
455
+ //#region src/feishu/infra/adapters/intake/feishu-message-intake.d.ts
745
456
  type FeishuMessageIntakeSummary = FeishuPromptMessageIntakeSummary | FeishuNewSessionMessageIntakeSummary | FeishuCancelMessageIntakeSummary;
746
457
  interface FeishuMessageIntakeBaseSummary {
747
458
  readonly messageId: string;
@@ -762,7 +473,7 @@ interface FeishuCancelMessageIntakeSummary extends FeishuMessageIntakeBaseSummar
762
473
  readonly runId?: AgentRunId;
763
474
  }
764
475
  //#endregion
765
- //#region src/adapters/feishu/intake/feishu-agent-daemon.d.ts
476
+ //#region src/feishu/infra/adapters/intake/feishu-agent-daemon.d.ts
766
477
  interface FeishuAgentDaemonRunResult {
767
478
  readonly messageId: string;
768
479
  readonly runId: string;
@@ -802,7 +513,7 @@ interface FeishuAgentDaemonHandleMessageOptions {
802
513
  readonly sideEffects?: FeishuAgentMessageSideEffects;
803
514
  }
804
515
  //#endregion
805
- //#region src/adapters/feishu/inbound-delivery/feishu-inbound-delivery.d.ts
516
+ //#region src/feishu/infra/adapters/inbound-delivery/feishu-inbound-delivery.d.ts
806
517
  type FeishuMessageAcceptResult = {
807
518
  readonly accepted: true;
808
519
  readonly messageId: string;
@@ -822,7 +533,7 @@ interface FeishuMessageDrainAvailableResult {
822
533
  }>;
823
534
  }
824
535
  //#endregion
825
- //#region src/adapters/feishu/runtime/feishu-receive-status.d.ts
536
+ //#region src/feishu/infra/adapters/runtime/feishu-receive-status.d.ts
826
537
  type FeishuReceiveMessageReplayOptions = FeishuAgentDaemonHandleMessageOptions;
827
538
  interface FeishuReceiveMessageReplayResult {
828
539
  readonly accepted: FeishuMessageAcceptResult;
@@ -830,48 +541,9 @@ interface FeishuReceiveMessageReplayResult {
830
541
  readonly intake: FeishuMessageIntakeSummary;
831
542
  }
832
543
  //#endregion
833
- //#region src/platform/home/config/runtime/rivus-daemon-config.d.ts
834
- type RivusDaemonEnv = Readonly<Record<string, string | undefined>>;
835
- //#endregion
836
- //#region src/platform/home/rivus-home.d.ts
837
- type RivusHomeEnvironment = Readonly<Record<string, string | undefined>>;
838
- interface RivusHome {
839
- readonly bootstrap: string;
840
- readonly directory: string;
841
- readonly envFilePath: string;
842
- readonly logsDirectory: string;
843
- readonly manifestPath: string;
844
- readonly stateDirectory: string;
845
- readonly workspaceDirectory: string;
846
- }
847
- interface InitializedRivusHome {
848
- readonly directory: string;
849
- readonly files: ReadonlyArray<string>;
850
- }
851
- interface RivusHomeDoctorCheck {
852
- readonly message: string;
853
- readonly name: "node" | "home" | "workspace" | "modules" | "manifest" | "credentials";
854
- readonly status: "pass" | "fail";
855
- }
856
- interface RivusHomeDoctorReport {
857
- readonly checks: ReadonlyArray<RivusHomeDoctorCheck>;
858
- readonly directory: string;
859
- readonly ready: boolean;
860
- }
861
- interface RivusHomeApi {
862
- diagnose(input: {
863
- readonly directory: string;
864
- readonly env: RivusHomeEnvironment;
865
- readonly envFilePath?: string;
866
- readonly nodeVersion: string;
867
- }): Effect.Effect<RivusHomeDoctorReport, Error>;
868
- load(directory: string): Effect.Effect<RivusHome, Error>;
869
- setup(directory: string): Effect.Effect<InitializedRivusHome, Error>;
870
- }
871
- //#endregion
872
544
  //#region src/bootstrap/deployment/rivus-deployment-cli-process.d.ts
873
545
  interface RivusDeploymentBootstrapAdapters {
874
- readonly initialInstanceRecords?: AgentInstanceRegistryOptions["initialRecords"];
546
+ readonly initialInstanceRecords?: ReadonlyArray<AgentInstanceRecord>;
875
547
  readonly dispose?: () => Promise<void> | void;
876
548
  readonly createAutomation?: RivusDeploymentAutomationFactoryPort["create"];
877
549
  readonly createBackgroundSession?: RivusDeploymentBackgroundSessionFactoryPort["create"];
@@ -892,5 +564,5 @@ interface RivusDeploymentBootstrapContext {
892
564
  }
893
565
  type RivusDeploymentBootstrapFactory = (context: RivusDeploymentBootstrapContext) => Promise<RivusDeploymentBootstrapAdapters> | RivusDeploymentBootstrapAdapters;
894
566
  //#endregion
895
- export { AutomationPresentationKind as A, RivusAutomationInput as C, RivusAutomationTickContext as D, RivusAutomationTemplate as E, AutomationPresentationTableColumn as F, AutomationPresentationTrend as I, readAutomationPresentation as L, AutomationPresentationSource as M, AutomationPresentationTable as N, AutomationPresentation as O, AutomationPresentationTableCell as P, AutomationLineChart as R, RivusAutomationFailure as S, RivusAutomationRetryPolicy as T, RivusPluginManifest as _, RivusDaemonEnv as a, RivusAgentProfile as b, CreateRivusDeploymentEndpointPortInput as c, RivusDeploymentEndpointPort as d, RivusDeploymentRuntimePort as f, RIVUS_PLUGIN_API_VERSION as g, RivusPluginRegistry as h, RivusHomeApi as i, AutomationPresentationSection as j, AutomationPresentationItem as k, CreateRivusDeploymentRuntimePortInput as l, RivusPluginCatalog as m, RivusDeploymentBootstrapFactory as n, CreateRivusDeploymentAutomationPortInput as o, RivusPlugin as p, RivusHome as r, CreateRivusDeploymentBackgroundSessionPortInput as s, RivusDeploymentBootstrapContext as t, RivusDeploymentBackgroundSessionPort as u, ResolvedRivusAgentDefinition as v, RivusAutomationOutput as w, AutomationScheduler as x, RivusAgentDeployment as y, RecoveryControl as z };
567
+ export { RivusHome as a, CreateRivusDeploymentEndpointPortInput as c, RivusDeploymentEndpointPort as d, RivusDeploymentRuntimePort as f, RivusHomeApi as i, CreateRivusDeploymentRuntimePortInput as l, RivusDeploymentBootstrapFactory as n, CreateRivusDeploymentAutomationPortInput as o, RecoveryControl as p, RivusDaemonEnv as r, CreateRivusDeploymentBackgroundSessionPortInput as s, RivusDeploymentBootstrapContext as t, RivusDeploymentBackgroundSessionPort as u };
896
568
  export {};