forked from froooze/DEXBot2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenfang_bridge.js
More file actions
49 lines (43 loc) · 1.03 KB
/
openfang_bridge.js
File metadata and controls
49 lines (43 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
const {
createClawBridge,
describeClawBridge,
runClawCommand
} = require('./claw_bridge');
function createOpenFangBridge(options = {}) {
return createClawBridge({
...options,
runtime: {
...(options.runtime || {}),
name: options.runtime?.name || 'openfang-bridge'
}
});
}
function describeOpenFangBridge(options = {}) {
const manifest = describeClawBridge({
...options,
runtimeName: 'openfang',
scriptPath: 'node scripts/openfang_bridge.js'
});
return {
...manifest,
compatibility: {
...manifest.compatibility,
name: 'OpenFang',
trustModel: 'OpenFang sends intents and reads context; AI-Bot handles signing through DEXBot2'
}
};
}
function runOpenFangCommand(command, options = {}) {
if (command === 'manifest') {
return describeOpenFangBridge(options);
}
return runClawCommand(command, {
...options,
runtimeName: options.runtimeName || 'openfang'
});
}
module.exports = {
createOpenFangBridge,
describeOpenFangBridge,
runOpenFangCommand
};