@rivus/gateway 0.21.2 → 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.
- package/README.md +4 -1
- package/assets/audio-transcriber/fetch-model.mjs +63 -70
- package/assets/audio-transcriber/transcribe.mjs +38 -47
- package/assets/installation-policy.json +4 -3
- package/dist/bootstrap/feishu.d.ts +7 -2
- package/dist/bootstrap/feishu.js +19195 -17153
- package/dist/bootstrap/herdr-feishu.d.ts +1 -7
- package/dist/bootstrap/herdr-feishu.js +23 -12
- package/dist/chunks/automation-presentation.js +58 -60
- package/dist/chunks/feishu-receive-message.js +113 -0
- package/dist/chunks/herdr-feishu-runtime.js +1027 -642
- package/dist/chunks/public.d.ts +278 -0
- package/dist/chunks/public2.d.ts +10 -0
- package/dist/chunks/rivus-deployment-cli-process.d.ts +127 -455
- package/dist/chunks/rivus-home-deployment-env.js +1342 -1781
- package/dist/chunks/rivus-node-entrypoint.js +4349 -4063
- package/dist/index.d.ts +23 -11
- package/dist/mcp.d.ts +10 -9
- package/dist/mcp.js +43 -43
- package/package.json +15 -11
- package/templates/a-share-briefing-analysis.mjs +32 -34
- package/templates/a-share-briefing-renderer.mjs +175 -186
- package/templates/a-share-index-evidence.mjs +50 -54
- package/templates/a-share-market-briefing.mjs +37 -39
- package/templates/a-share-overseas-evidence.mjs +35 -39
- package/templates/a-share-policy-evidence.mjs +90 -96
- package/templates/a-share-sector-evidence.mjs +32 -35
- package/templates/acp-stdio-proxy.mjs +21 -22
- package/templates/current-weather.mjs +56 -58
- package/templates/html-drive-tools.mjs +130 -141
- package/templates/rivus-agents.plugin.mjs +55 -57
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { Context, Effect, Layer, 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/automation/domain/automation-occurrence/value-objects/occurrence-recovery.d.ts
|
|
4
|
+
interface AutomationOccurrenceRecovery {
|
|
5
|
+
readonly actorId: string;
|
|
6
|
+
readonly at: string;
|
|
7
|
+
readonly note: string;
|
|
8
|
+
readonly attemptLimit: number;
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/automation/domain/automation-occurrence/value-objects/occurrence-stop.d.ts
|
|
12
|
+
interface AutomationOccurrenceStop {
|
|
13
|
+
readonly reason: "attempt-limit" | "terminal-failure";
|
|
14
|
+
readonly code?: string;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/automation/domain/automation-occurrence/aggregates/snapshot.d.ts
|
|
18
|
+
type AutomationOccurrenceStatus = "running" | "failed" | "generated" | "suppressed" | "delivered" | "stopped";
|
|
19
|
+
interface AutomationOccurrenceSnapshot {
|
|
20
|
+
readonly attempts: number;
|
|
21
|
+
readonly attemptLimit: number | null;
|
|
22
|
+
readonly automationId: string;
|
|
23
|
+
readonly body?: string;
|
|
24
|
+
readonly error?: string;
|
|
25
|
+
readonly mandateId: string;
|
|
26
|
+
readonly occurrence: string;
|
|
27
|
+
readonly presentation?: unknown;
|
|
28
|
+
readonly providerMessageId?: string;
|
|
29
|
+
readonly recoveries: ReadonlyArray<AutomationOccurrenceRecovery>;
|
|
30
|
+
readonly revision: number;
|
|
31
|
+
readonly runId?: string;
|
|
32
|
+
readonly status: AutomationOccurrenceStatus;
|
|
33
|
+
readonly stop?: AutomationOccurrenceStop;
|
|
34
|
+
readonly suppressionReason?: string;
|
|
35
|
+
readonly tickId: string;
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/automation/domain/presentation/adapters/automation-line-chart.d.ts
|
|
39
|
+
interface AutomationLineChart {
|
|
40
|
+
readonly title: string;
|
|
41
|
+
readonly labels: ReadonlyArray<string>;
|
|
42
|
+
readonly unit: string;
|
|
43
|
+
readonly seriesLayout?: "overlay" | "separate";
|
|
44
|
+
readonly series: ReadonlyArray<{
|
|
45
|
+
readonly name: string;
|
|
46
|
+
readonly values: ReadonlyArray<number>;
|
|
47
|
+
}>;
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/automation/application/services/automation-presentation.d.ts
|
|
51
|
+
declare const AUTOMATION_PRESENTATION_SCHEMA_VERSION: 2;
|
|
52
|
+
type AutomationPresentationKind = "daily-ai" | "generic" | "industry" | "news" | "subscriptions";
|
|
53
|
+
type AutomationPresentationTrend = "up" | "down" | "flat";
|
|
54
|
+
interface AutomationPresentationSource {
|
|
55
|
+
readonly label: string;
|
|
56
|
+
readonly url: string;
|
|
57
|
+
}
|
|
58
|
+
interface AutomationPresentationTableCell {
|
|
59
|
+
readonly text: string;
|
|
60
|
+
readonly trend?: AutomationPresentationTrend;
|
|
61
|
+
}
|
|
62
|
+
interface AutomationPresentationTableColumn {
|
|
63
|
+
readonly label: string;
|
|
64
|
+
readonly align?: "left" | "center" | "right";
|
|
65
|
+
readonly width?: number;
|
|
66
|
+
}
|
|
67
|
+
interface AutomationPresentationTable {
|
|
68
|
+
readonly columns: ReadonlyArray<AutomationPresentationTableColumn>;
|
|
69
|
+
readonly rows: ReadonlyArray<ReadonlyArray<AutomationPresentationTableCell>>;
|
|
70
|
+
}
|
|
71
|
+
interface AutomationPresentationItem {
|
|
72
|
+
readonly emphasis?: "accent";
|
|
73
|
+
readonly headline: string;
|
|
74
|
+
readonly note?: string;
|
|
75
|
+
readonly sources: ReadonlyArray<AutomationPresentationSource>;
|
|
76
|
+
}
|
|
77
|
+
interface AutomationPresentationSection {
|
|
78
|
+
readonly collapsed?: boolean;
|
|
79
|
+
readonly id: string;
|
|
80
|
+
readonly items: ReadonlyArray<AutomationPresentationItem>;
|
|
81
|
+
readonly lineChart?: AutomationLineChart;
|
|
82
|
+
readonly listStyle?: "bullet" | "numbered" | "plain";
|
|
83
|
+
readonly style?: "plain" | "highlight";
|
|
84
|
+
readonly table?: AutomationPresentationTable;
|
|
85
|
+
readonly title: string;
|
|
86
|
+
}
|
|
87
|
+
interface AutomationPresentation {
|
|
88
|
+
readonly footer?: string;
|
|
89
|
+
readonly lineChart?: AutomationLineChart;
|
|
90
|
+
readonly footnote?: string;
|
|
91
|
+
readonly kind?: AutomationPresentationKind;
|
|
92
|
+
readonly meta: ReadonlyArray<string>;
|
|
93
|
+
readonly schemaVersion: typeof AUTOMATION_PRESENTATION_SCHEMA_VERSION;
|
|
94
|
+
readonly sectionDividers?: boolean;
|
|
95
|
+
readonly sections: ReadonlyArray<AutomationPresentationSection>;
|
|
96
|
+
readonly subtitle?: string;
|
|
97
|
+
readonly summary?: string;
|
|
98
|
+
readonly summaryStyle?: "plain" | "highlight";
|
|
99
|
+
readonly title: string;
|
|
100
|
+
readonly trendColors?: "red-up" | "green-up";
|
|
101
|
+
}
|
|
102
|
+
declare function readAutomationPresentation(value: unknown): AutomationPresentation;
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region src/automation/application/ports.d.ts
|
|
105
|
+
interface ScheduledAutomationRunInput {
|
|
106
|
+
readonly occurrence: string;
|
|
107
|
+
readonly sessionKey: string;
|
|
108
|
+
readonly text: string;
|
|
109
|
+
readonly tickId: string;
|
|
110
|
+
}
|
|
111
|
+
//#endregion
|
|
112
|
+
//#region src/automation/domain/automation-occurrence/value-objects/rivus-automation-retry-policy.d.ts
|
|
113
|
+
interface RivusAutomationRetryPolicy {
|
|
114
|
+
readonly maxAttempts: number;
|
|
115
|
+
readonly terminalFailureCodes?: ReadonlyArray<string>;
|
|
116
|
+
}
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region src/automation/application/use-cases/automation-scheduler.d.ts
|
|
119
|
+
interface AutomationScheduler {
|
|
120
|
+
running(): boolean;
|
|
121
|
+
runDue(at: Date): Effect.Effect<AutomationOccurrenceSnapshot | undefined, unknown>;
|
|
122
|
+
start(): Effect.Effect<void>;
|
|
123
|
+
stop(): Effect.Effect<void>;
|
|
124
|
+
}
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region src/agent-catalog/application/services/rivus-agent-definition.d.ts
|
|
127
|
+
interface RivusAgentProfile {
|
|
128
|
+
readonly id: string;
|
|
129
|
+
readonly displayName: string;
|
|
130
|
+
readonly systemPrompt: string;
|
|
131
|
+
readonly model: Readonly<Record<string, unknown>>;
|
|
132
|
+
readonly tools: {
|
|
133
|
+
readonly allow: ReadonlyArray<string>;
|
|
134
|
+
};
|
|
135
|
+
readonly skills: {
|
|
136
|
+
readonly allow: ReadonlyArray<string>;
|
|
137
|
+
};
|
|
138
|
+
readonly memory: {
|
|
139
|
+
readonly scopes: ReadonlyArray<RivusMemoryScope>;
|
|
140
|
+
};
|
|
141
|
+
readonly runtimeTools?: {
|
|
142
|
+
readonly allow: ReadonlyArray<RivusRuntimeToolId>;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
interface RegisteredRivusAgentProfile extends RivusAgentProfile {
|
|
146
|
+
readonly pluginId: string;
|
|
147
|
+
}
|
|
148
|
+
interface RivusAgentDeployment {
|
|
149
|
+
readonly agentId: string;
|
|
150
|
+
readonly pluginId: string;
|
|
151
|
+
readonly profileId: string;
|
|
152
|
+
readonly projectSpaceId?: string;
|
|
153
|
+
readonly endpointIds: ReadonlyArray<string>;
|
|
154
|
+
readonly memory?: {
|
|
155
|
+
readonly scopes: ReadonlyArray<RivusMemoryScope>;
|
|
156
|
+
readonly tool: boolean;
|
|
157
|
+
};
|
|
158
|
+
readonly runtime?: {
|
|
159
|
+
readonly type: "acp";
|
|
160
|
+
readonly command: string;
|
|
161
|
+
readonly args?: ReadonlyArray<string>;
|
|
162
|
+
readonly env?: Readonly<Record<string, string>>;
|
|
163
|
+
readonly permissions?: "ask" | "deny";
|
|
164
|
+
readonly steering?: "disabled" | "cancel-and-reprompt";
|
|
165
|
+
readonly unattended?: boolean;
|
|
166
|
+
readonly initializationTimeoutMs?: number;
|
|
167
|
+
};
|
|
168
|
+
readonly runtimeTools?: {
|
|
169
|
+
readonly allow: ReadonlyArray<RivusRuntimeToolId>;
|
|
170
|
+
};
|
|
171
|
+
readonly skills: {
|
|
172
|
+
readonly allow: ReadonlyArray<string>;
|
|
173
|
+
};
|
|
174
|
+
readonly tools: {
|
|
175
|
+
readonly allow: ReadonlyArray<string>;
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
interface ResolvedRivusAgentDefinition {
|
|
179
|
+
readonly agentId: string;
|
|
180
|
+
readonly pluginId: string;
|
|
181
|
+
readonly profileId: string;
|
|
182
|
+
readonly projectSpaceId?: string;
|
|
183
|
+
readonly projectSpaceRevision?: string;
|
|
184
|
+
readonly endpointIds: ReadonlyArray<string>;
|
|
185
|
+
readonly profileRevision: string;
|
|
186
|
+
readonly systemPrompt: string;
|
|
187
|
+
readonly model: Readonly<Record<string, unknown>>;
|
|
188
|
+
readonly memory: {
|
|
189
|
+
readonly scopes: ReadonlyArray<RivusMemoryScope>;
|
|
190
|
+
readonly tool: boolean;
|
|
191
|
+
};
|
|
192
|
+
readonly runtime?: Required<NonNullable<RivusAgentDeployment["runtime"]>>;
|
|
193
|
+
readonly runtimeToolGrantSet: RivusRuntimeToolGrantSet;
|
|
194
|
+
readonly skillGrantSet: RivusSkillGrantSet;
|
|
195
|
+
readonly skills: ReadonlyArray<RegisteredRivusSkill>;
|
|
196
|
+
readonly tools: ReadonlyArray<RivusResolvedToolDescriptor>;
|
|
197
|
+
readonly toolGrantSet: RivusToolGrantSet;
|
|
198
|
+
}
|
|
199
|
+
//#endregion
|
|
200
|
+
//#region src/agent-catalog/domain/plugin/value-objects/rivus-plugin.d.ts
|
|
201
|
+
declare const RIVUS_PLUGIN_API_VERSION = "1";
|
|
202
|
+
interface RivusPluginManifest {
|
|
203
|
+
readonly apiVersion: string;
|
|
204
|
+
readonly id: string;
|
|
205
|
+
readonly version: string;
|
|
206
|
+
}
|
|
207
|
+
interface RegisteredRivusPlugin extends RivusPluginManifest {}
|
|
208
|
+
//#endregion
|
|
209
|
+
//#region src/agent-catalog/application/spi.d.ts
|
|
210
|
+
interface RivusAutomationTemplate {
|
|
211
|
+
readonly id: string;
|
|
212
|
+
readonly profileId: string;
|
|
213
|
+
readonly requestedSkillIds: ReadonlyArray<string>;
|
|
214
|
+
readonly requestedToolIds: ReadonlyArray<string>;
|
|
215
|
+
readonly retry?: RivusAutomationRetryPolicy;
|
|
216
|
+
readonly createInput: (tick: RivusAutomationTickContext) => RivusAutomationInput;
|
|
217
|
+
readonly createPresentation?: (output: RivusAutomationOutput) => AutomationPresentation;
|
|
218
|
+
}
|
|
219
|
+
interface RivusAutomationTickContext {
|
|
220
|
+
readonly occurrence: string;
|
|
221
|
+
}
|
|
222
|
+
interface RivusAutomationInput {
|
|
223
|
+
readonly text: string;
|
|
224
|
+
}
|
|
225
|
+
interface RivusAutomationOutput {
|
|
226
|
+
readonly occurrence: string;
|
|
227
|
+
readonly text: string;
|
|
228
|
+
}
|
|
229
|
+
interface RegisteredRivusAutomation extends RivusAutomationTemplate {
|
|
230
|
+
readonly pluginId: string;
|
|
231
|
+
}
|
|
232
|
+
interface RivusPluginRegistry {
|
|
233
|
+
registerAgentProfile(profile: RivusAgentProfile): void;
|
|
234
|
+
registerTool(tool: RivusToolDescriptor): void;
|
|
235
|
+
registerSkill(skill: RivusSkillDescriptor): void;
|
|
236
|
+
registerAutomation(template: RivusAutomationTemplate): void;
|
|
237
|
+
}
|
|
238
|
+
interface RivusPlugin {
|
|
239
|
+
readonly manifest: RivusPluginManifest;
|
|
240
|
+
register(registry: RivusPluginRegistry): void;
|
|
241
|
+
}
|
|
242
|
+
interface RivusPluginCatalogSnapshot {
|
|
243
|
+
readonly plugins: ReadonlyArray<RegisteredRivusPlugin>;
|
|
244
|
+
readonly profiles: ReadonlyArray<RegisteredRivusAgentProfile>;
|
|
245
|
+
readonly tools: ReadonlyArray<RegisteredRivusTool>;
|
|
246
|
+
readonly skills: ReadonlyArray<RegisteredRivusSkill>;
|
|
247
|
+
readonly automations: ReadonlyArray<RegisteredRivusAutomation>;
|
|
248
|
+
}
|
|
249
|
+
interface RivusPluginCatalog {
|
|
250
|
+
registerPlugin(plugin: RivusPlugin): void;
|
|
251
|
+
snapshot(): RivusPluginCatalogSnapshot;
|
|
252
|
+
}
|
|
253
|
+
//#endregion
|
|
254
|
+
//#region src/agent-host/application/ports.d.ts
|
|
255
|
+
interface AgentRuntimeInput {
|
|
256
|
+
readonly attachmentAccess?: AttachmentAccess;
|
|
257
|
+
readonly invocation?: AgentInvocationOrigin;
|
|
258
|
+
readonly onUpdate?: (update: AgentRunUpdate) => Effect.Effect<void, unknown>;
|
|
259
|
+
readonly payload?: unknown;
|
|
260
|
+
readonly sessionKey: SessionKey;
|
|
261
|
+
readonly text: string;
|
|
262
|
+
readonly userInput?: UserInput;
|
|
263
|
+
}
|
|
264
|
+
interface AgentRuntimeCancellation {
|
|
265
|
+
readonly reason?: string;
|
|
266
|
+
readonly runId: AgentRunId;
|
|
267
|
+
readonly sessionKey: SessionKey;
|
|
268
|
+
}
|
|
269
|
+
interface AgentRuntimeSteering {
|
|
270
|
+
readonly attachmentAccess?: AttachmentAccess;
|
|
271
|
+
readonly runId: AgentRunId;
|
|
272
|
+
readonly sessionKey: SessionKey;
|
|
273
|
+
readonly text: string;
|
|
274
|
+
readonly userInput?: UserInput;
|
|
275
|
+
}
|
|
276
|
+
//#endregion
|
|
277
|
+
export { AutomationLineChart as A, AutomationPresentationSection as C, AutomationPresentationTableColumn as D, AutomationPresentationTableCell as E, AutomationPresentationTrend as O, AutomationPresentationKind as S, AutomationPresentationTable as T, AutomationScheduler as _, RivusAutomationInput as a, AutomationPresentation as b, RivusAutomationTickContext as c, RivusPluginRegistry as d, RIVUS_PLUGIN_API_VERSION as f, RivusAgentProfile as g, RivusAgentDeployment as h, RegisteredRivusAutomation as i, readAutomationPresentation as k, RivusPlugin as l, ResolvedRivusAgentDefinition as m, AgentRuntimeInput as n, RivusAutomationOutput as o, RivusPluginManifest as p, AgentRuntimeSteering as r, RivusAutomationTemplate as s, AgentRuntimeCancellation as t, RivusPluginCatalog as u, RivusAutomationRetryPolicy as v, AutomationPresentationSource as w, AutomationPresentationItem as x, ScheduledAutomationRunInput as y };
|
|
278
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
2
|
+
import { ProcessLockPlatform } from "@rivus/agent-kit-collab/process-lock";
|
|
3
|
+
//#region src/terminal-session/infra/adapters/herdr/herdr-socket-client.d.ts
|
|
4
|
+
interface HerdrSessionConfig {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly socketPath: string;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { HerdrSessionConfig as t };
|
|
10
|
+
export {};
|