@rivus/gateway 0.16.2 → 0.17.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/LICENSE +674 -21
- package/README.md +25 -0
- package/dist/bootstrap/herdr-feishu.d.ts +37 -0
- package/dist/bootstrap/herdr-feishu.js +856 -0
- package/dist/bootstrap/pi-feishu.d.ts +281 -16
- package/dist/bootstrap/pi-feishu.js +17314 -344
- package/dist/chunks/background-session-authority.js +2 -38
- package/dist/chunks/rivus-daemon-cli.d.ts +1115 -0
- package/dist/chunks/rivus-node-entrypoint.js +700 -819
- package/dist/chunks/{node-rivus-deployment-manifest.js → runtime-cache.js} +1116 -1475
- package/dist/cli.d.ts +2 -1
- package/dist/cli.js +1 -0
- package/dist/index.d.ts +65 -3
- package/dist/index.js +3 -1215
- package/dist/mcp.d.ts +7 -63
- package/dist/mcp.js +3 -250
- package/package.json +29 -14
- package/templates/a-share-briefing-analysis.mjs +3 -1
- package/templates/a-share-briefing-renderer.mjs +15 -5
- package/templates/a-share-index-evidence.mjs +9 -3
- package/templates/a-share-market-briefing.mjs +3 -1
- package/templates/a-share-overseas-evidence.mjs +12 -4
- package/templates/a-share-policy-evidence.mjs +30 -10
- package/templates/a-share-sector-evidence.mjs +3 -1
- package/templates/acp-stdio-proxy.mjs +10 -4
- package/templates/current-weather.mjs +36 -12
- package/templates/herdr-feishu.mjs +30 -0
- package/templates/html-drive-tools.mjs +36 -12
- package/templates/pi-feishu-deployment.bootstrap.ts +1 -3
- package/templates/pi-feishu.bootstrap.ts +1 -242
- package/templates/rivus-agents.plugin.mjs +3 -1
- package/dist/chunks/background-session-control-input.js +0 -45
- package/dist/chunks/background-session-service.d.ts +0 -390
- package/dist/chunks/index.d.ts +0 -4703
- package/dist/chunks/service.js +0 -12112
- package/templates/langfuse-drive-e2e.mjs +0 -175
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
//#region src/core/application/background-session/authority/background-session-identity.ts
|
|
2
|
-
const BACKGROUND_SESSION_SESSION_KEY_PREFIX = "background";
|
|
3
|
-
function createBackgroundSessionKey(sessionId) {
|
|
4
|
-
return `${BACKGROUND_SESSION_SESSION_KEY_PREFIX}:${sessionId}`;
|
|
5
|
-
}
|
|
6
|
-
function createBackgroundSessionStepSourceMessageId(sessionId, stepCount) {
|
|
7
|
-
return `bg:${sessionId}:step:${stepCount}`;
|
|
8
|
-
}
|
|
9
|
-
//#endregion
|
|
10
1
|
//#region src/core/application/background-session/authority/background-session-authority.ts
|
|
11
|
-
const BACKGROUND_SESSION_TOOL_IDS = [
|
|
12
|
-
"background.start",
|
|
13
|
-
"background.wait",
|
|
14
|
-
"background.list",
|
|
15
|
-
"background.status",
|
|
16
|
-
"background.send",
|
|
17
|
-
"background.stop"
|
|
18
|
-
];
|
|
19
2
|
const BACKGROUND_SESSION_START_TOOL_ID = "background.start";
|
|
20
3
|
const BACKGROUND_SESSION_TOOL_PLUGIN_ID = "rivus-core";
|
|
21
4
|
const BACKGROUND_SESSION_TOOL_VERSION = "1.0.0";
|
|
@@ -188,26 +171,6 @@ function createBackgroundSessionToolContracts() {
|
|
|
188
171
|
})
|
|
189
172
|
];
|
|
190
173
|
}
|
|
191
|
-
function backgroundSessionToolIds() {
|
|
192
|
-
return [...BACKGROUND_SESSION_TOOL_IDS];
|
|
193
|
-
}
|
|
194
|
-
function isBackgroundSessionToolId(toolId) {
|
|
195
|
-
return BACKGROUND_SESSION_TOOL_IDS.includes(toolId);
|
|
196
|
-
}
|
|
197
|
-
function extendBackgroundSessionDefinition(definition, digest) {
|
|
198
|
-
const contracts = createBackgroundSessionToolContracts();
|
|
199
|
-
const existingIds = new Set(definition.tools.map(({ id }) => id));
|
|
200
|
-
const additions = contracts.filter((contract) => !existingIds.has(contract.id));
|
|
201
|
-
const toolGrantSet = Object.freeze({
|
|
202
|
-
revision: grantRevision(digest, definition.toolGrantSet.revision, additions.map(({ id }) => id)),
|
|
203
|
-
toolIds: Object.freeze([...definition.toolGrantSet.toolIds, ...additions.map(({ id }) => id)].sort())
|
|
204
|
-
});
|
|
205
|
-
return Object.freeze({
|
|
206
|
-
...definition,
|
|
207
|
-
tools: Object.freeze([...definition.tools, ...additions]),
|
|
208
|
-
toolGrantSet
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
174
|
function narrowBackgroundSessionDefinition(definition, digest) {
|
|
212
175
|
const childToolIds = definition.toolGrantSet.toolIds.filter((id) => id !== BACKGROUND_SESSION_START_TOOL_ID);
|
|
213
176
|
const toolGrantSet = Object.freeze({
|
|
@@ -227,4 +190,5 @@ function grantRevision(digest, parentRevision, toolIds) {
|
|
|
227
190
|
}));
|
|
228
191
|
}
|
|
229
192
|
//#endregion
|
|
230
|
-
export {
|
|
193
|
+
export { narrowBackgroundSessionDefinition as n, createBackgroundSessionToolContracts as t };
|
|
194
|
+
|