@rivus/gateway 0.16.2
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/LICENSE +21 -0
- package/README.md +6 -0
- package/dist/bootstrap/pi-feishu.d.ts +20 -0
- package/dist/bootstrap/pi-feishu.js +671 -0
- package/dist/chunks/background-session-authority.js +230 -0
- package/dist/chunks/background-session-control-input.js +45 -0
- package/dist/chunks/background-session-service.d.ts +390 -0
- package/dist/chunks/index.d.ts +4703 -0
- package/dist/chunks/node-rivus-deployment-manifest.js +1650 -0
- package/dist/chunks/rivus-node-entrypoint.js +4464 -0
- package/dist/chunks/service.js +12112 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +16 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1215 -0
- package/dist/mcp.d.ts +92 -0
- package/dist/mcp.js +455 -0
- package/package.json +64 -0
- package/skills/runtime-management/SKILL.md +65 -0
- package/templates/a-share-briefing-analysis.mjs +93 -0
- package/templates/a-share-briefing-renderer.mjs +257 -0
- package/templates/a-share-index-evidence.mjs +99 -0
- package/templates/a-share-market-briefing.mjs +83 -0
- package/templates/a-share-market-date.mjs +10 -0
- package/templates/a-share-overseas-evidence.mjs +86 -0
- package/templates/a-share-policy-evidence.mjs +145 -0
- package/templates/a-share-provider-response.mjs +21 -0
- package/templates/a-share-sector-evidence.mjs +70 -0
- package/templates/acp-stdio-proxy.mjs +58 -0
- package/templates/current-weather.mjs +117 -0
- package/templates/html-drive-tools.mjs +262 -0
- package/templates/https-response-reader.mjs +36 -0
- package/templates/langfuse-drive-e2e.mjs +175 -0
- package/templates/pi-feishu-deployment.bootstrap.ts +3 -0
- package/templates/pi-feishu.bootstrap.ts +242 -0
- package/templates/rivus-agents.plugin.mjs +290 -0
- package/templates/rivus-langfuse-demo.config.json +37 -0
- package/templates/rivus-starter.plugin.mjs +47 -0
- package/templates/rivus.config.json +114 -0
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
|
|
5
|
+
import { readCurrentWeather } from "./current-weather.mjs";
|
|
6
|
+
import { readAShareMarketBriefing } from "./a-share-market-briefing.mjs";
|
|
7
|
+
import { createHtmlArtifactWriter, createLarkDriveHtmlUploader } from "./html-drive-tools.mjs";
|
|
8
|
+
|
|
9
|
+
const TOOL_IDS = {
|
|
10
|
+
aShareMarketBriefing: "rivus-example-agents/a-share-market-briefing",
|
|
11
|
+
currentWeather: "rivus-example-agents/current-weather",
|
|
12
|
+
larkDriveUploadHtml: "rivus-example-agents/lark-drive-upload-html",
|
|
13
|
+
runtimeInfo: "rivus-example-agents/runtime-info",
|
|
14
|
+
saveNote: "rivus-example-agents/save-note",
|
|
15
|
+
writeHtmlArtifact: "rivus-example-agents/write-html-artifact"
|
|
16
|
+
};
|
|
17
|
+
const AGENT_A_TOOL_IDS = [
|
|
18
|
+
TOOL_IDS.runtimeInfo,
|
|
19
|
+
TOOL_IDS.saveNote,
|
|
20
|
+
TOOL_IDS.currentWeather,
|
|
21
|
+
TOOL_IDS.aShareMarketBriefing
|
|
22
|
+
];
|
|
23
|
+
const AGENT_B_TOOL_IDS = [TOOL_IDS.runtimeInfo, TOOL_IDS.saveNote, TOOL_IDS.currentWeather];
|
|
24
|
+
const WEATHER_INSTRUCTION =
|
|
25
|
+
"遇到当前或今日天气问题时必须调用 current-weather;用户未指定地点时不要猜测,省略 location 并在回答中明确说明工具返回的默认地点。";
|
|
26
|
+
const MEMORY_INSTRUCTION =
|
|
27
|
+
"用户明确要求记住、回忆或遗忘偏好时,必须调用 rivus_memory;propose 会持久化一条可在同 Scope 后续检索的待确认候选,不得声称用户已经确认,也不得声称候选尚未写入。";
|
|
28
|
+
const DAILY_WORD_AUTOMATION_ID = "rivus-example-agents/daily-ielts-word";
|
|
29
|
+
const A_SHARE_PRE_MARKET_AUTOMATION_ID = "rivus-example-agents/a-share-pre-market";
|
|
30
|
+
const A_SHARE_POST_MARKET_AUTOMATION_ID = "rivus-example-agents/a-share-post-market";
|
|
31
|
+
const LANGFUSE_PUBLISHER_SKILL_ID = "rivus-example-agents/langfuse-html-publisher";
|
|
32
|
+
const LANGFUSE_PUBLISHER_SKILL = Object.freeze({
|
|
33
|
+
content: [
|
|
34
|
+
"Use this skill when the user asks for a polished HTML page that must be published to Feishu Drive.",
|
|
35
|
+
"1. Design a responsive, accessible, self-contained HTML document with semantic sections and inline CSS. Do not use external scripts or remote assets.",
|
|
36
|
+
"2. Call write-html-artifact exactly once with the complete document. Do not claim a file exists before the Tool succeeds.",
|
|
37
|
+
"3. Read the returned artifactId, then call lark-drive-upload-html exactly once with that artifactId and a descriptive .html file name.",
|
|
38
|
+
"4. Return the verified Drive URL and a concise summary of the page. A local path alone is not a completed publication.",
|
|
39
|
+
"5. Treat metrics, timings, costs, evaluations, and execution claims as facts only when a Tool result or supplied trace contains them. Clearly label any illustrative data as synthetic.",
|
|
40
|
+
"6. For Langfuse technical facts, use this official-doc reference verified on 2026-07-15: Trace is the root execution and Observations are nestable steps (do not claim unlimited nesting); supported Observation types are event, span, generation, agent, tool, chain, retriever, evaluator, embedding, and guardrail. A current Python example imports get_client and uses with langfuse.start_as_current_observation(as_type=..., name=...) plus observation.update(...), followed by langfuse.flush() for short-lived processes. The standard environment variables are LANGFUSE_SECRET_KEY, LANGFUSE_PUBLIC_KEY, and LANGFUSE_BASE_URL. Never use the removed v2 langfuse.trace(), trace.generation(), or trace.span() APIs, and never shorten the credential names to LANGFUSE_SECRET or LANGFUSE_PUBLIC.",
|
|
41
|
+
"7. Any credential example in the page must use these exact illustrative values: LANGFUSE_SECRET_KEY=sk-lf-... ; LANGFUSE_PUBLIC_KEY=pk-lf-... ; LANGFUSE_BASE_URL=https://jp.cloud.langfuse.com . The values are placeholders, not real credentials.",
|
|
42
|
+
"Official references: https://langfuse.com/docs/observability/data-model ; https://langfuse.com/docs/observability/features/observation-types ; https://langfuse.com/docs/observability/get-started"
|
|
43
|
+
].join("\n"),
|
|
44
|
+
digest: "sha256:example-langfuse-html-publisher-v5",
|
|
45
|
+
id: LANGFUSE_PUBLISHER_SKILL_ID,
|
|
46
|
+
title: "Langfuse HTML publisher",
|
|
47
|
+
version: "5.0.0"
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export default {
|
|
51
|
+
manifest: {
|
|
52
|
+
apiVersion: "1",
|
|
53
|
+
id: "rivus-example-agents",
|
|
54
|
+
version: "0.1.0"
|
|
55
|
+
},
|
|
56
|
+
register(registry) {
|
|
57
|
+
registry.registerTool({
|
|
58
|
+
createExecutor: () => ({
|
|
59
|
+
execute: (_input, context) => ({
|
|
60
|
+
agentId: context.agentId,
|
|
61
|
+
instanceId: context.instanceId,
|
|
62
|
+
policyEpoch: context.policyEpoch,
|
|
63
|
+
runId: context.runId
|
|
64
|
+
})
|
|
65
|
+
}),
|
|
66
|
+
description: "Read the trusted Rivus runtime identity for the current run",
|
|
67
|
+
digest: "sha256:example-runtime-info-v1",
|
|
68
|
+
id: TOOL_IDS.runtimeInfo,
|
|
69
|
+
idempotency: "none",
|
|
70
|
+
inputSchema: { additionalProperties: false, properties: {}, type: "object" },
|
|
71
|
+
risk: "observe",
|
|
72
|
+
version: "1.0.0"
|
|
73
|
+
});
|
|
74
|
+
registry.registerTool({
|
|
75
|
+
createExecutor: () => ({ execute: saveNote }),
|
|
76
|
+
description: "Persist a Markdown note in the local Rivus deployment state",
|
|
77
|
+
digest: "sha256:example-save-note-v1",
|
|
78
|
+
id: TOOL_IDS.saveNote,
|
|
79
|
+
idempotency: "required",
|
|
80
|
+
inputSchema: {
|
|
81
|
+
additionalProperties: false,
|
|
82
|
+
properties: {
|
|
83
|
+
text: { minLength: 1, type: "string" },
|
|
84
|
+
title: { minLength: 1, type: "string" }
|
|
85
|
+
},
|
|
86
|
+
required: ["title", "text"],
|
|
87
|
+
type: "object"
|
|
88
|
+
},
|
|
89
|
+
risk: "irreversible",
|
|
90
|
+
version: "1.0.0"
|
|
91
|
+
});
|
|
92
|
+
registry.registerTool({
|
|
93
|
+
createExecutor: () => ({ execute: readCurrentWeather }),
|
|
94
|
+
description:
|
|
95
|
+
"Read current conditions and today's forecast from Open-Meteo. When location is omitted, use the deployment's configured default location.",
|
|
96
|
+
digest: "sha256:example-current-weather-v1",
|
|
97
|
+
id: TOOL_IDS.currentWeather,
|
|
98
|
+
idempotency: "none",
|
|
99
|
+
inputSchema: {
|
|
100
|
+
additionalProperties: false,
|
|
101
|
+
properties: {
|
|
102
|
+
location: {
|
|
103
|
+
description: "City or place name. Omit it when the user did not specify a location.",
|
|
104
|
+
maxLength: 100,
|
|
105
|
+
minLength: 1,
|
|
106
|
+
type: "string"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
type: "object"
|
|
110
|
+
},
|
|
111
|
+
risk: "observe",
|
|
112
|
+
version: "1.0.0"
|
|
113
|
+
});
|
|
114
|
+
registry.registerTool({
|
|
115
|
+
createExecutor: () => ({ execute: readAShareMarketBriefing }),
|
|
116
|
+
description:
|
|
117
|
+
"Read a bounded, evidence-backed A-share pre-market or post-market analysis briefing with attributed facts, labeled inferences, source time, and stale-data handling",
|
|
118
|
+
digest: "sha256:example-a-share-market-briefing-v3",
|
|
119
|
+
id: TOOL_IDS.aShareMarketBriefing,
|
|
120
|
+
idempotency: "none",
|
|
121
|
+
inputSchema: {
|
|
122
|
+
additionalProperties: false,
|
|
123
|
+
properties: {
|
|
124
|
+
occurrence: { format: "date-time", type: "string" },
|
|
125
|
+
session: { enum: ["pre-market", "post-market"], type: "string" }
|
|
126
|
+
},
|
|
127
|
+
required: ["session", "occurrence"],
|
|
128
|
+
type: "object"
|
|
129
|
+
},
|
|
130
|
+
risk: "observe",
|
|
131
|
+
version: "1.1.0"
|
|
132
|
+
});
|
|
133
|
+
registry.registerTool({
|
|
134
|
+
createExecutor: () => createHtmlArtifactWriter(),
|
|
135
|
+
description:
|
|
136
|
+
"Write one complete, self-contained HTML document into the trusted Rivus artifact directory and return its artifactId",
|
|
137
|
+
digest: "sha256:example-write-html-artifact-v1",
|
|
138
|
+
id: TOOL_IDS.writeHtmlArtifact,
|
|
139
|
+
idempotency: "required",
|
|
140
|
+
inputSchema: {
|
|
141
|
+
additionalProperties: false,
|
|
142
|
+
properties: {
|
|
143
|
+
html: {
|
|
144
|
+
description: "Complete HTML document beginning with <!doctype html> and ending with </html>",
|
|
145
|
+
maxLength: 262144,
|
|
146
|
+
minLength: 100,
|
|
147
|
+
type: "string"
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
required: ["html"],
|
|
151
|
+
type: "object"
|
|
152
|
+
},
|
|
153
|
+
risk: "mutate",
|
|
154
|
+
version: "1.0.0"
|
|
155
|
+
});
|
|
156
|
+
registry.registerTool({
|
|
157
|
+
createExecutor: () => createLarkDriveHtmlUploader(),
|
|
158
|
+
description:
|
|
159
|
+
"Upload a previously generated HTML artifact to the current user's Feishu Drive root by invoking lark-cli",
|
|
160
|
+
digest: "sha256:example-lark-drive-upload-html-v1",
|
|
161
|
+
id: TOOL_IDS.larkDriveUploadHtml,
|
|
162
|
+
idempotency: "required",
|
|
163
|
+
inputSchema: {
|
|
164
|
+
additionalProperties: false,
|
|
165
|
+
properties: {
|
|
166
|
+
artifactId: {
|
|
167
|
+
description: "artifactId returned by write-html-artifact",
|
|
168
|
+
pattern: "^[a-f0-9]{32}$",
|
|
169
|
+
type: "string"
|
|
170
|
+
},
|
|
171
|
+
name: {
|
|
172
|
+
description: "Safe destination file name ending in .html",
|
|
173
|
+
maxLength: 125,
|
|
174
|
+
minLength: 6,
|
|
175
|
+
pattern: "^[^/\\\\]{1,120}\\.html$",
|
|
176
|
+
type: "string"
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
required: ["artifactId", "name"],
|
|
180
|
+
type: "object"
|
|
181
|
+
},
|
|
182
|
+
risk: "mutate",
|
|
183
|
+
version: "1.0.0"
|
|
184
|
+
});
|
|
185
|
+
registry.registerSkill(LANGFUSE_PUBLISHER_SKILL);
|
|
186
|
+
registry.registerAgentProfile({
|
|
187
|
+
displayName: "Rivus Agent A",
|
|
188
|
+
id: "agent-a",
|
|
189
|
+
memory: { scopes: ["agent-private"] },
|
|
190
|
+
model: {},
|
|
191
|
+
skills: { allow: [] },
|
|
192
|
+
systemPrompt: `You are Rivus Agent A. Be concise, analytical, and explicit about evidence. ${WEATHER_INSTRUCTION} ${MEMORY_INSTRUCTION}`,
|
|
193
|
+
tools: { allow: AGENT_A_TOOL_IDS }
|
|
194
|
+
});
|
|
195
|
+
registry.registerAgentProfile({
|
|
196
|
+
displayName: "Rivus Agent B",
|
|
197
|
+
id: "agent-b",
|
|
198
|
+
memory: { scopes: ["agent-private"] },
|
|
199
|
+
model: {},
|
|
200
|
+
skills: { allow: [] },
|
|
201
|
+
systemPrompt: `You are Rivus Agent B. Focus on independent verification and clearly state uncertainty. ${WEATHER_INSTRUCTION} ${MEMORY_INSTRUCTION}`,
|
|
202
|
+
tools: { allow: AGENT_B_TOOL_IDS }
|
|
203
|
+
});
|
|
204
|
+
registry.registerAgentProfile({
|
|
205
|
+
displayName: "Rivus Langfuse publishing demo",
|
|
206
|
+
id: "langfuse-demo",
|
|
207
|
+
memory: { scopes: [] },
|
|
208
|
+
model: {},
|
|
209
|
+
skills: { allow: [LANGFUSE_PUBLISHER_SKILL_ID] },
|
|
210
|
+
systemPrompt: [
|
|
211
|
+
"You are the isolated Rivus Langfuse publishing demo Agent.",
|
|
212
|
+
`Before planning or publishing, read and follow the granted Skill ${LANGFUSE_PUBLISHER_SKILL_ID}.`,
|
|
213
|
+
"Use only Tool results and user-provided evidence for factual execution claims."
|
|
214
|
+
].join(" "),
|
|
215
|
+
tools: { allow: [TOOL_IDS.writeHtmlArtifact, TOOL_IDS.larkDriveUploadHtml] }
|
|
216
|
+
});
|
|
217
|
+
registry.registerAutomation({
|
|
218
|
+
createInput: ({ occurrence }) => ({
|
|
219
|
+
text: [
|
|
220
|
+
`计划发生时间:${occurrence}。为中文雅思学习者生成且只生成一张今日单词卡。`,
|
|
221
|
+
"选择一个雅思高频但不太基础的英文单词。",
|
|
222
|
+
"必须依次包含:单词、英式和美式 IPA、中文发音提示、词性与中文释义、一个雅思语境英文例句及中文翻译、常用搭配、记忆提示。",
|
|
223
|
+
"最后提供可直接点击收听发音的 Cambridge Dictionary 链接:https://dictionary.cambridge.org/pronunciation/english/<小写单词>。",
|
|
224
|
+
"使用飞书富文本支持的 Markdown 排版:以二级标题开头,字段名加粗,例句、搭配和记忆提示分段或列表展示,发音链接使用 Markdown 链接语法。不要使用表格,不要解释生成过程,也不要输出多个候选词。"
|
|
225
|
+
].join("\n")
|
|
226
|
+
}),
|
|
227
|
+
id: DAILY_WORD_AUTOMATION_ID,
|
|
228
|
+
profileId: "agent-a",
|
|
229
|
+
requestedSkillIds: [],
|
|
230
|
+
requestedToolIds: []
|
|
231
|
+
});
|
|
232
|
+
registry.registerAutomation(createAShareAutomation(A_SHARE_PRE_MARKET_AUTOMATION_ID, "pre-market"));
|
|
233
|
+
registry.registerAutomation(createAShareAutomation(A_SHARE_POST_MARKET_AUTOMATION_ID, "post-market"));
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
function createAShareAutomation(id, session) {
|
|
238
|
+
const label = session === "pre-market" ? "盘前" : "盘后";
|
|
239
|
+
return {
|
|
240
|
+
createInput: ({ occurrence }) => {
|
|
241
|
+
const parameters = JSON.stringify({ session, occurrence });
|
|
242
|
+
return {
|
|
243
|
+
text: [
|
|
244
|
+
`计划发生时间:${occurrence}。生成 A 股${label}简报。`,
|
|
245
|
+
`必须且只调用一次 ${TOOL_IDS.aShareMarketBriefing},参数严格使用:${parameters}。`,
|
|
246
|
+
"工具返回的 markdown 字段已区分市场事实和分析推断并列出来源,就是最终交付正文;必须原样输出,不增加开场、解释、预测、荐股、因果归因或任何工具结果之外的数字。",
|
|
247
|
+
"如果工具失败,不得估算或补全行情,让本次 Automation 明确失败以便按同一 Tick 重试。"
|
|
248
|
+
].join("\n")
|
|
249
|
+
};
|
|
250
|
+
},
|
|
251
|
+
id,
|
|
252
|
+
profileId: "agent-a",
|
|
253
|
+
requestedSkillIds: [],
|
|
254
|
+
requestedToolIds: [TOOL_IDS.aShareMarketBriefing]
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
async function saveNote(input, context) {
|
|
259
|
+
if (
|
|
260
|
+
!input ||
|
|
261
|
+
typeof input !== "object" ||
|
|
262
|
+
typeof input.title !== "string" ||
|
|
263
|
+
!input.title.trim() ||
|
|
264
|
+
typeof input.text !== "string" ||
|
|
265
|
+
!input.text.trim() ||
|
|
266
|
+
!context.operationId
|
|
267
|
+
) {
|
|
268
|
+
throw new Error("save-note requires title, text, and a trusted operation id");
|
|
269
|
+
}
|
|
270
|
+
const directory = join(
|
|
271
|
+
process.cwd(),
|
|
272
|
+
".rivus",
|
|
273
|
+
"deployment",
|
|
274
|
+
"tool-output",
|
|
275
|
+
createHash("sha256").update(context.agentId).digest("hex").slice(0, 16)
|
|
276
|
+
);
|
|
277
|
+
const fileName = `${context.operationId.replace(/[^a-zA-Z0-9_-]/g, "_")}.md`;
|
|
278
|
+
const filePath = join(directory, fileName);
|
|
279
|
+
const content = `# ${input.title.trim()}\n\n${input.text.trim()}\n`;
|
|
280
|
+
await mkdir(directory, { recursive: true });
|
|
281
|
+
try {
|
|
282
|
+
await writeFile(filePath, content, { encoding: "utf8", flag: "wx" });
|
|
283
|
+
} catch (error) {
|
|
284
|
+
if (!(error instanceof Error) || !("code" in error) || error.code !== "EEXIST") throw error;
|
|
285
|
+
if ((await readFile(filePath, "utf8")) !== content) {
|
|
286
|
+
throw new Error("operation id is already bound to different note content");
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
return { path: `.rivus/deployment/tool-output/${fileName}`, saved: true };
|
|
290
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"plugins": [
|
|
3
|
+
{
|
|
4
|
+
"id": "rivus-example-agents",
|
|
5
|
+
"module": "./rivus-agents.plugin.mjs",
|
|
6
|
+
"required": true
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"agents": [
|
|
10
|
+
{
|
|
11
|
+
"agentId": "langfuse-demo",
|
|
12
|
+
"endpointIds": ["langfuse-demo-feishu"],
|
|
13
|
+
"pluginId": "rivus-example-agents",
|
|
14
|
+
"profileId": "langfuse-demo",
|
|
15
|
+
"skills": { "allow": ["rivus-example-agents/langfuse-html-publisher"] },
|
|
16
|
+
"tools": {
|
|
17
|
+
"allow": ["rivus-example-agents/write-html-artifact", "rivus-example-agents/lark-drive-upload-html"]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"endpoints": [
|
|
22
|
+
{
|
|
23
|
+
"id": "langfuse-demo-feishu",
|
|
24
|
+
"agentId": "langfuse-demo",
|
|
25
|
+
"sessionNamespace": "langfuse-demo-v1",
|
|
26
|
+
"credentialRef": "env:RIVUS_AGENT_A_FEISHU",
|
|
27
|
+
"enabled": true,
|
|
28
|
+
"required": true,
|
|
29
|
+
"baseUrl": "https://open.feishu.cn",
|
|
30
|
+
"streamMinIntervalMs": 200,
|
|
31
|
+
"progressDisplay": "collapsed",
|
|
32
|
+
"groupPolicy": "ignore-unmentioned"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"defaultAgentId": "langfuse-demo",
|
|
36
|
+
"defaultEndpointId": "langfuse-demo-feishu"
|
|
37
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { readCurrentWeather } from "./current-weather.mjs";
|
|
2
|
+
|
|
3
|
+
const TOOL_ID = "rivus-starter/current-weather";
|
|
4
|
+
const RUNTIME_TOOLS = ["read", "bash", "edit", "write", "grep", "find", "ls"];
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
manifest: {
|
|
8
|
+
apiVersion: "1",
|
|
9
|
+
id: "rivus-starter",
|
|
10
|
+
version: "1.0.0"
|
|
11
|
+
},
|
|
12
|
+
register(registry) {
|
|
13
|
+
registry.registerTool({
|
|
14
|
+
createExecutor: () => ({ execute: readCurrentWeather }),
|
|
15
|
+
description:
|
|
16
|
+
"Read current conditions and today's forecast from Open-Meteo, using the configured default when location is omitted",
|
|
17
|
+
digest: "sha256:rivus-starter-current-weather-v1",
|
|
18
|
+
id: TOOL_ID,
|
|
19
|
+
idempotency: "none",
|
|
20
|
+
inputSchema: {
|
|
21
|
+
additionalProperties: false,
|
|
22
|
+
properties: {
|
|
23
|
+
location: {
|
|
24
|
+
description: "City or place name. Omit it when the user did not specify one.",
|
|
25
|
+
maxLength: 100,
|
|
26
|
+
minLength: 1,
|
|
27
|
+
type: "string"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
type: "object"
|
|
31
|
+
},
|
|
32
|
+
risk: "observe",
|
|
33
|
+
version: "1.0.0"
|
|
34
|
+
});
|
|
35
|
+
registry.registerAgentProfile({
|
|
36
|
+
displayName: "Rivus Agent",
|
|
37
|
+
id: "agent-a",
|
|
38
|
+
memory: { scopes: ["agent-private"] },
|
|
39
|
+
model: {},
|
|
40
|
+
runtimeTools: { allow: RUNTIME_TOOLS },
|
|
41
|
+
skills: { allow: [] },
|
|
42
|
+
systemPrompt:
|
|
43
|
+
"You are a concise local assistant. For current or today's weather, call current-weather. If the user did not name a location, omit location and report the Tool's resolved place.",
|
|
44
|
+
tools: { allow: [TOOL_ID] }
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
{
|
|
2
|
+
"plugins": [
|
|
3
|
+
{
|
|
4
|
+
"id": "rivus-example-agents",
|
|
5
|
+
"module": "./rivus-agents.plugin.mjs",
|
|
6
|
+
"required": true
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"agents": [
|
|
10
|
+
{
|
|
11
|
+
"agentId": "agent-a",
|
|
12
|
+
"endpointIds": ["feishu-agent-a"],
|
|
13
|
+
"memory": { "scopes": ["agent-private"], "tool": true },
|
|
14
|
+
"pluginId": "rivus-example-agents",
|
|
15
|
+
"profileId": "agent-a",
|
|
16
|
+
"skills": { "allow": [] },
|
|
17
|
+
"tools": {
|
|
18
|
+
"allow": [
|
|
19
|
+
"rivus-example-agents/runtime-info",
|
|
20
|
+
"rivus-example-agents/save-note",
|
|
21
|
+
"rivus-example-agents/current-weather",
|
|
22
|
+
"rivus-example-agents/a-share-market-briefing"
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"agentId": "agent-b",
|
|
28
|
+
"endpointIds": ["feishu-agent-b"],
|
|
29
|
+
"memory": { "scopes": ["agent-private"], "tool": true },
|
|
30
|
+
"pluginId": "rivus-example-agents",
|
|
31
|
+
"profileId": "agent-b",
|
|
32
|
+
"skills": { "allow": [] },
|
|
33
|
+
"tools": {
|
|
34
|
+
"allow": [
|
|
35
|
+
"rivus-example-agents/runtime-info",
|
|
36
|
+
"rivus-example-agents/save-note",
|
|
37
|
+
"rivus-example-agents/current-weather"
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"automations": [
|
|
43
|
+
{
|
|
44
|
+
"id": "daily-ielts-word",
|
|
45
|
+
"agentId": "agent-a",
|
|
46
|
+
"templateId": "rivus-example-agents/daily-ielts-word",
|
|
47
|
+
"enabled": false,
|
|
48
|
+
"required": true,
|
|
49
|
+
"schedule": "0 10 * * *",
|
|
50
|
+
"timeZone": "Asia/Shanghai",
|
|
51
|
+
"delivery": {
|
|
52
|
+
"endpointId": "feishu-agent-a",
|
|
53
|
+
"targetRef": "env:RIVUS_DAILY_IELTS_WORD_TARGET",
|
|
54
|
+
"targetType": "union_id"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"id": "a-share-pre-market",
|
|
59
|
+
"agentId": "agent-a",
|
|
60
|
+
"templateId": "rivus-example-agents/a-share-pre-market",
|
|
61
|
+
"enabled": false,
|
|
62
|
+
"required": true,
|
|
63
|
+
"schedule": "0 9 * * 1-5",
|
|
64
|
+
"timeZone": "Asia/Shanghai",
|
|
65
|
+
"delivery": {
|
|
66
|
+
"endpointId": "feishu-agent-a",
|
|
67
|
+
"targetRef": "env:RIVUS_A_SHARE_BRIEFING_TARGET",
|
|
68
|
+
"targetType": "union_id"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"id": "a-share-post-market",
|
|
73
|
+
"agentId": "agent-a",
|
|
74
|
+
"templateId": "rivus-example-agents/a-share-post-market",
|
|
75
|
+
"enabled": false,
|
|
76
|
+
"required": true,
|
|
77
|
+
"schedule": "0 16 * * 1-5",
|
|
78
|
+
"timeZone": "Asia/Shanghai",
|
|
79
|
+
"delivery": {
|
|
80
|
+
"endpointId": "feishu-agent-a",
|
|
81
|
+
"targetRef": "env:RIVUS_A_SHARE_BRIEFING_TARGET",
|
|
82
|
+
"targetType": "union_id"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
"endpoints": [
|
|
87
|
+
{
|
|
88
|
+
"id": "feishu-agent-a",
|
|
89
|
+
"agentId": "agent-a",
|
|
90
|
+
"sessionNamespace": "feishu-agent-a-v1",
|
|
91
|
+
"credentialRef": "env:RIVUS_AGENT_A_FEISHU",
|
|
92
|
+
"enabled": true,
|
|
93
|
+
"required": true,
|
|
94
|
+
"baseUrl": "https://open.feishu.cn",
|
|
95
|
+
"streamMinIntervalMs": 200,
|
|
96
|
+
"progressDisplay": "collapsed",
|
|
97
|
+
"groupPolicy": "mention-only"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"id": "feishu-agent-b",
|
|
101
|
+
"agentId": "agent-b",
|
|
102
|
+
"sessionNamespace": "feishu-agent-b-v1",
|
|
103
|
+
"credentialRef": "env:RIVUS_AGENT_B_FEISHU",
|
|
104
|
+
"enabled": true,
|
|
105
|
+
"required": true,
|
|
106
|
+
"baseUrl": "https://open.feishu.cn",
|
|
107
|
+
"streamMinIntervalMs": 200,
|
|
108
|
+
"progressDisplay": "collapsed",
|
|
109
|
+
"groupPolicy": "mention-only"
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"defaultAgentId": "agent-a",
|
|
113
|
+
"defaultEndpointId": "feishu-agent-a"
|
|
114
|
+
}
|