@rivus/agent 0.1.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -3
- package/dist/cli.js +504 -5
- package/dist/index.d.ts +11 -9
- package/dist/index.js +70 -33
- package/dist/rivus-daemon-cli.js +547 -520
- package/dist/rivus-plugin-testkit.js +2 -2
- package/examples/pi-feishu-deployment.bootstrap.ts +2 -2
- package/examples/rivus-starter.plugin.mjs +45 -0
- package/package.json +11 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as resolveRivusAgentDefinition, t as createRivusPluginCatalog } from "./rivus-plugin-registry.js";
|
|
1
|
+
import { a as RIVUS_MEMORY_TOOL_ID, n as resolveRivusAgentDefinition, t as createRivusPluginCatalog } from "./rivus-plugin-registry.js";
|
|
2
2
|
//#region src/testing/rivus-plugin-testkit.ts
|
|
3
3
|
var RivusPluginConformanceError = class extends Error {
|
|
4
4
|
name = "RivusPluginConformanceError";
|
|
@@ -7,7 +7,7 @@ async function assertRivusPluginConforms(input) {
|
|
|
7
7
|
const catalog = createRivusPluginCatalog();
|
|
8
8
|
catalog.registerPlugin(input.plugin);
|
|
9
9
|
const resolved = resolveRivusAgentDefinition(catalog, input.deployment);
|
|
10
|
-
const requested = new Set(input.deployment.tools.allow);
|
|
10
|
+
const requested = /* @__PURE__ */ new Set([...input.deployment.tools.allow, ...input.deployment.memory?.tool === true ? [RIVUS_MEMORY_TOOL_ID] : []]);
|
|
11
11
|
if (resolved.toolGrantSet.toolIds.some((id) => !requested.has(id))) throw new RivusPluginConformanceError("resolved ToolGrantSet expanded beyond deployment request");
|
|
12
12
|
if (input.lifecycle) {
|
|
13
13
|
const lifecycle = await input.lifecycle.activate();
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
createAgentHarness,
|
|
16
16
|
createAgentHarnessPooledRuntime,
|
|
17
17
|
createRivusMemoryToolDescriptor,
|
|
18
|
-
|
|
18
|
+
createConfiguredFeishuAutomationCardSender,
|
|
19
19
|
createConfiguredFeishuCardKitPublisher,
|
|
20
20
|
createConfiguredFeishuCardKitTargetPreparation,
|
|
21
21
|
createConfiguredFeishuHumanInteractionPresenter,
|
|
@@ -113,7 +113,7 @@ export async function createRivusDeploymentAdapters(context: RivusDeploymentBoot
|
|
|
113
113
|
pi: {}
|
|
114
114
|
};
|
|
115
115
|
const openApiClient = createOpenApiClient(config);
|
|
116
|
-
const sender =
|
|
116
|
+
const sender = createConfiguredFeishuAutomationCardSender({
|
|
117
117
|
client: openApiClient,
|
|
118
118
|
config
|
|
119
119
|
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { readCurrentWeather } from "./current-weather.mjs";
|
|
2
|
+
|
|
3
|
+
const TOOL_ID = "rivus-starter/current-weather";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
manifest: {
|
|
7
|
+
apiVersion: "1",
|
|
8
|
+
id: "rivus-starter",
|
|
9
|
+
version: "1.0.0"
|
|
10
|
+
},
|
|
11
|
+
register(registry) {
|
|
12
|
+
registry.registerTool({
|
|
13
|
+
createExecutor: () => ({ execute: readCurrentWeather }),
|
|
14
|
+
description:
|
|
15
|
+
"Read current conditions and today's forecast from Open-Meteo, using the configured default when location is omitted",
|
|
16
|
+
digest: "sha256:rivus-starter-current-weather-v1",
|
|
17
|
+
id: TOOL_ID,
|
|
18
|
+
idempotency: "none",
|
|
19
|
+
inputSchema: {
|
|
20
|
+
additionalProperties: false,
|
|
21
|
+
properties: {
|
|
22
|
+
location: {
|
|
23
|
+
description: "City or place name. Omit it when the user did not specify one.",
|
|
24
|
+
maxLength: 100,
|
|
25
|
+
minLength: 1,
|
|
26
|
+
type: "string"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
type: "object"
|
|
30
|
+
},
|
|
31
|
+
risk: "observe",
|
|
32
|
+
version: "1.0.0"
|
|
33
|
+
});
|
|
34
|
+
registry.registerAgentProfile({
|
|
35
|
+
displayName: "Rivus Agent",
|
|
36
|
+
id: "agent-a",
|
|
37
|
+
memory: { scopes: [] },
|
|
38
|
+
model: {},
|
|
39
|
+
skills: { allow: [] },
|
|
40
|
+
systemPrompt:
|
|
41
|
+
"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.",
|
|
42
|
+
tools: { allow: [TOOL_ID] }
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rivus/agent",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "A local agent daemon core built around a usable agent harness and domain events.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -49,6 +49,8 @@
|
|
|
49
49
|
"scripts": {
|
|
50
50
|
"audit": "npm audit --audit-level=high",
|
|
51
51
|
"build": "vp pack",
|
|
52
|
+
"changeset": "changeset",
|
|
53
|
+
"changeset:status": "changeset status",
|
|
52
54
|
"e2e:langfuse-drive": "vp pack && node --env-file=.env.local examples/langfuse-drive-e2e.mjs",
|
|
53
55
|
"format": "vp fmt",
|
|
54
56
|
"format:check": "vp fmt --check",
|
|
@@ -62,7 +64,9 @@
|
|
|
62
64
|
"test:watch": "vp test watch",
|
|
63
65
|
"typecheck": "vp check --no-fmt --no-lint",
|
|
64
66
|
"check": "vp check && vp test --coverage && vp run duplicates && vp pack && vp run package:check && vp run audit && ./scripts/check-repository.sh",
|
|
65
|
-
"duplicates": "jscpd src examples --min-lines 6 --min-tokens 40 --threshold 0 --reporters console --ignore '**/*.test.ts,**/*.test.mjs' --format 'typescript,javascript,json'"
|
|
67
|
+
"duplicates": "jscpd src examples --min-lines 6 --min-tokens 40 --threshold 0 --reporters console --ignore '**/*.test.ts,**/*.test.mjs' --format 'typescript,javascript,json'",
|
|
68
|
+
"version-packages": "changeset version && npm install --package-lock-only --ignore-scripts",
|
|
69
|
+
"version-packages:ci": "npm run version-packages && npm run check"
|
|
66
70
|
},
|
|
67
71
|
"dependencies": {
|
|
68
72
|
"@opentelemetry/api": "^1.9.1",
|
|
@@ -74,7 +78,7 @@
|
|
|
74
78
|
"typebox": "^1.1.38"
|
|
75
79
|
},
|
|
76
80
|
"peerDependencies": {
|
|
77
|
-
"@earendil-works/pi-coding-agent": "
|
|
81
|
+
"@earendil-works/pi-coding-agent": "0.80.6",
|
|
78
82
|
"@larksuiteoapi/node-sdk": "^1.70.0"
|
|
79
83
|
},
|
|
80
84
|
"peerDependenciesMeta": {
|
|
@@ -86,11 +90,12 @@
|
|
|
86
90
|
}
|
|
87
91
|
},
|
|
88
92
|
"devDependencies": {
|
|
93
|
+
"@changesets/cli": "^2.31.1",
|
|
89
94
|
"@earendil-works/pi-coding-agent": "0.80.6",
|
|
90
|
-
"@larksuiteoapi/node-sdk": "1.
|
|
91
|
-
"@types/node": "24.
|
|
95
|
+
"@larksuiteoapi/node-sdk": "1.71.1",
|
|
96
|
+
"@types/node": "24.13.3",
|
|
92
97
|
"@vitest/coverage-v8": "4.1.10",
|
|
93
|
-
"jscpd": "4.
|
|
98
|
+
"jscpd": "4.2.5",
|
|
94
99
|
"typescript": "6.0.3",
|
|
95
100
|
"vite": "npm:@voidzero-dev/vite-plus-core@0.2.4",
|
|
96
101
|
"vite-plus": "0.2.4"
|