@olane/os 0.7.2 → 0.7.3
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.
|
@@ -1,115 +1,118 @@
|
|
|
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
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
1
|
+
import { NodeState } from '@olane/o-core';
|
|
2
|
+
import { expect } from 'chai';
|
|
3
|
+
import dotenv from 'dotenv';
|
|
4
|
+
import { defaultOSInstance } from '../utils/os.default.js';
|
|
5
|
+
import { OlaneOSSystemStatus } from '../../src/o-olane-os/enum/o-os.status-enum.js';
|
|
6
|
+
import { oNodeAddress, oNodeTransport } from '@olane/o-node';
|
|
7
|
+
import { multiaddr } from '@olane/o-config';
|
|
8
|
+
dotenv.config();
|
|
9
|
+
const network = defaultOSInstance;
|
|
10
|
+
describe('basic-usage @initialize', async () => {
|
|
11
|
+
it('should be able to startup the network', async () => {
|
|
12
|
+
await network.start();
|
|
13
|
+
expect(network.status).to.equal(OlaneOSSystemStatus.RUNNING);
|
|
14
|
+
});
|
|
15
|
+
// disabled for now, to avoid unecessary indexing costs
|
|
16
|
+
// it('should be able to index the network', async () => {
|
|
17
|
+
// const entryNode = network.entryNode();
|
|
18
|
+
// expect(entryNode).to.exist;
|
|
19
|
+
// expect(entryNode.state).to.equal(NodeState.RUNNING);
|
|
20
|
+
// const response = await entryNode.use(new oAddress('o://leader'), {
|
|
21
|
+
// method: 'index_network',
|
|
22
|
+
// params: {},
|
|
23
|
+
// });
|
|
24
|
+
// const data = response.result.data;
|
|
25
|
+
// expect(data).to.exist;
|
|
26
|
+
// expect(data.error).to.be.undefined;
|
|
27
|
+
// expect(data.message).to.equal('Network indexed!');
|
|
28
|
+
// });
|
|
29
|
+
it('should be able to use olane remote services', async () => {
|
|
30
|
+
const entryNode = network.entryNode();
|
|
31
|
+
expect(entryNode).to.exist;
|
|
32
|
+
expect(entryNode.state).to.equal(NodeState.RUNNING);
|
|
33
|
+
// configure the intelligence tool
|
|
34
|
+
// await entryNode.use(new oAddress('o://intelligence'), {
|
|
35
|
+
// method: 'configure',
|
|
36
|
+
// params: {
|
|
37
|
+
// modelProvider: 'anthropic',
|
|
38
|
+
// hostingProvider: 'olane',
|
|
39
|
+
// accessToken: 'test',
|
|
40
|
+
// address: 'o://leader/intelligence',
|
|
41
|
+
// },
|
|
42
|
+
// });
|
|
43
|
+
// use the intelligence tool
|
|
44
|
+
const response2 = await entryNode.use(new oNodeAddress('o://perplexity', [
|
|
45
|
+
new oNodeTransport(multiaddr('/ip4/127.0.0.1/tcp/4000/ws/p2p/12D3KooWPHdsHhEdyBd9DS2zHJ1vRSyqSkZ97iT7F8ByYJ7U7bw8')),
|
|
46
|
+
]), {
|
|
47
|
+
method: 'completion',
|
|
48
|
+
params: {
|
|
49
|
+
model: 'sonar',
|
|
50
|
+
messages: [
|
|
51
|
+
{
|
|
52
|
+
role: 'user',
|
|
53
|
+
content: 'What is the weather in Tokyo?',
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
console.log(response2.result.data);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
// describe('olane network usage', async () => {
|
|
62
|
+
// it('should be able to use the olane network', async () => {
|
|
63
|
+
// // let's dial the other network
|
|
64
|
+
// const response = await network.use(
|
|
65
|
+
// new oAddress('o://leader', [
|
|
66
|
+
// multiaddr('/dns4/leader.olane.com/tcp/4000/tls/ws'),
|
|
67
|
+
// ]),
|
|
68
|
+
// {
|
|
69
|
+
// method: 'intent',
|
|
70
|
+
// params: {
|
|
71
|
+
// intent: 'What can I do?',
|
|
72
|
+
// },
|
|
53
73
|
// },
|
|
54
|
-
//
|
|
55
|
-
// console.log(
|
|
74
|
+
// );
|
|
75
|
+
// console.log(response.result.data);
|
|
56
76
|
// });
|
|
57
77
|
// });
|
|
58
|
-
//
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
//
|
|
62
|
-
//
|
|
63
|
-
//
|
|
64
|
-
//
|
|
65
|
-
//
|
|
66
|
-
//
|
|
67
|
-
//
|
|
68
|
-
//
|
|
69
|
-
//
|
|
70
|
-
//
|
|
71
|
-
//
|
|
72
|
-
//
|
|
73
|
-
//
|
|
74
|
-
//
|
|
75
|
-
//
|
|
76
|
-
//
|
|
77
|
-
//
|
|
78
|
-
//
|
|
79
|
-
//
|
|
80
|
-
//
|
|
81
|
-
//
|
|
82
|
-
//
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
//
|
|
86
|
-
//
|
|
87
|
-
//
|
|
88
|
-
//
|
|
89
|
-
//
|
|
90
|
-
//
|
|
91
|
-
// // },
|
|
92
|
-
// // ],
|
|
93
|
-
// // plans: [],
|
|
94
|
-
// // noIndexNetwork: true,
|
|
95
|
-
// // });
|
|
96
|
-
// // await network2.start();
|
|
97
|
-
// // expect(network2.status).to.equal(NetworkStatus.RUNNING);
|
|
98
|
-
// // // let's dial the other network
|
|
99
|
-
// // await network2.use(
|
|
100
|
-
// // new oAddress('o://leader', [
|
|
101
|
-
// // ...(network?.rootLeader?.address.libp2pTransports || []),
|
|
102
|
-
// // ]),
|
|
103
|
-
// // {
|
|
104
|
-
// // method: 'index_network',
|
|
105
|
-
// // params: {},
|
|
106
|
-
// // },
|
|
107
|
-
// // );
|
|
108
|
-
// // });
|
|
109
|
-
// // });
|
|
110
|
-
// describe('basic-usage @stop-network', async () => {
|
|
111
|
-
// it('should be able to stop the network', async () => {
|
|
112
|
-
// await network.stop();
|
|
113
|
-
// expect(network.status).to.equal(OlaneOSSystemStatus.STOPPED);
|
|
78
|
+
// describe('external-networks', async () => {
|
|
79
|
+
// it('should be able to use an external network', async () => {
|
|
80
|
+
// const network2 = new oNetwork({
|
|
81
|
+
// // configFilePath: path.join(os.homedir(), '.olane', 'config.json'),
|
|
82
|
+
// nodes: [
|
|
83
|
+
// {
|
|
84
|
+
// type: NodeType.LEADER,
|
|
85
|
+
// address: new oAddress('o://leader'),
|
|
86
|
+
// leader: null,
|
|
87
|
+
// parent: null,
|
|
88
|
+
// },
|
|
89
|
+
// {
|
|
90
|
+
// type: NodeType.NODE,
|
|
91
|
+
// address: new oAddress('o://node2'),
|
|
92
|
+
// leader: null,
|
|
93
|
+
// parent: null,
|
|
94
|
+
// },
|
|
95
|
+
// ],
|
|
96
|
+
// plans: [],
|
|
97
|
+
// noIndexNetwork: true,
|
|
98
|
+
// });
|
|
99
|
+
// await network2.start();
|
|
100
|
+
// expect(network2.status).to.equal(NetworkStatus.RUNNING);
|
|
101
|
+
// // let's dial the other network
|
|
102
|
+
// await network2.use(
|
|
103
|
+
// new oAddress('o://leader', [
|
|
104
|
+
// ...(network?.rootLeader?.address.libp2pTransports || []),
|
|
105
|
+
// ]),
|
|
106
|
+
// {
|
|
107
|
+
// method: 'index_network',
|
|
108
|
+
// params: {},
|
|
109
|
+
// },
|
|
110
|
+
// );
|
|
114
111
|
// });
|
|
115
112
|
// });
|
|
113
|
+
describe('basic-usage @stop-network', async () => {
|
|
114
|
+
it('should be able to stop the network', async () => {
|
|
115
|
+
await network.stop();
|
|
116
|
+
expect(network.status).to.equal(OlaneOSSystemStatus.STOPPED);
|
|
117
|
+
});
|
|
118
|
+
});
|
|
@@ -1,68 +1,71 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
1
|
+
"use strict";
|
|
2
|
+
// import dotenv from 'dotenv';
|
|
3
|
+
// import { expect } from 'chai';
|
|
4
|
+
// import { defaultOSInstance } from '../utils/os.default.js';
|
|
5
|
+
// import { OlaneOSSystemStatus } from '../../src/o-olane-os/enum/o-os.status-enum.js';
|
|
6
|
+
// import { oAddress } from '@olane/o-core';
|
|
7
|
+
// import { GITHUB_TEST_CASES } from './github/github.test-cases.js';
|
|
8
|
+
// dotenv.config();
|
|
9
|
+
// const olaneOSInstance = defaultOSInstance;
|
|
10
|
+
// describe('basic-usage @initialize', async () => {
|
|
11
|
+
// it('should be able to startup the OS instance', async () => {
|
|
12
|
+
// await olaneOSInstance.start();
|
|
13
|
+
// expect(olaneOSInstance.status).to.equal(OlaneOSSystemStatus.RUNNING);
|
|
14
|
+
// });
|
|
15
|
+
// });
|
|
16
|
+
// // describe('intelligence @configure-intelligence', async () => {
|
|
17
|
+
// // it('should be able to set the intelligence preference to ollama', async () => {
|
|
18
|
+
// // await network.use(new oAddress('o://memory'), {
|
|
19
|
+
// // method: 'put',
|
|
20
|
+
// // params: {
|
|
21
|
+
// // key: 'intelligence-preference',
|
|
22
|
+
// // value: 'o://ollama',
|
|
23
|
+
// // },
|
|
24
|
+
// // });
|
|
25
|
+
// // });
|
|
26
|
+
// // });
|
|
27
|
+
// describe('o-mcp github-benchmarks', () => {
|
|
28
|
+
// // it('should be able to create a branch', async () => {
|
|
29
|
+
// // const response = await network.use(new oAddress('o://leader'), {
|
|
30
|
+
// // method: 'intent',
|
|
31
|
+
// // params: {
|
|
32
|
+
// // intent: `Create a branch called "test-branch" in the repo "travel-planner-app"`,
|
|
33
|
+
// // },
|
|
34
|
+
// // });
|
|
35
|
+
// // console.log(response.result.data);
|
|
36
|
+
// // }, 300_000);
|
|
37
|
+
// it('should be able to test github benchmarks', async () => {
|
|
38
|
+
// // const intent = `Add the MCP server https://api.githubcopilot.com/mcp/ use the headers "Authorization: Bearer ${process.env.GITHUB_API_KEY}"`;
|
|
39
|
+
// const intent =
|
|
40
|
+
// 'Add the linear mcp server with command "npx -y mcp-remote https://mcp.linear.app/sse"';
|
|
41
|
+
// const response = await olaneOSInstance.use(oAddress.leader(), {
|
|
42
|
+
// method: 'intent',
|
|
18
43
|
// params: {
|
|
19
|
-
//
|
|
20
|
-
// value: 'o://ollama',
|
|
44
|
+
// intent: intent,
|
|
21
45
|
// },
|
|
22
46
|
// });
|
|
47
|
+
// console.log('Setup MCP server response:');
|
|
48
|
+
// console.log(response.result.data);
|
|
49
|
+
// // for (const testCase of GITHUB_TEST_CASES) {
|
|
50
|
+
// // console.log(testCase.input);
|
|
51
|
+
// // const handshakeResponse = await olaneOSInstance.use(oAddress.leader(), {
|
|
52
|
+
// // method: 'intent',
|
|
53
|
+
// // params: {
|
|
54
|
+
// // intent: testCase.input,
|
|
55
|
+
// // },
|
|
56
|
+
// // });
|
|
57
|
+
// // console.log(
|
|
58
|
+
// // `Finished with ${(handshakeResponse.result.data as any).cycles} cycles`,
|
|
59
|
+
// // );
|
|
60
|
+
// // console.log(handshakeResponse.result.data);
|
|
61
|
+
// // // const result = await testCase.output;
|
|
62
|
+
// // // expect(result).to.contain(testCase.output.contains);
|
|
63
|
+
// // }
|
|
64
|
+
// }, 300_000);
|
|
65
|
+
// });
|
|
66
|
+
// describe('basic-usage @stop-network', async () => {
|
|
67
|
+
// it('should be able to stop the network', async () => {
|
|
68
|
+
// await olaneOSInstance.stop();
|
|
69
|
+
// expect(olaneOSInstance.status).to.equal(OlaneOSSystemStatus.STOPPED);
|
|
23
70
|
// });
|
|
24
71
|
// });
|
|
25
|
-
describe('o-mcp github-benchmarks', () => {
|
|
26
|
-
// it('should be able to create a branch', async () => {
|
|
27
|
-
// const response = await network.use(new oAddress('o://leader'), {
|
|
28
|
-
// method: 'intent',
|
|
29
|
-
// params: {
|
|
30
|
-
// intent: `Create a branch called "test-branch" in the repo "travel-planner-app"`,
|
|
31
|
-
// },
|
|
32
|
-
// });
|
|
33
|
-
// console.log(response.result.data);
|
|
34
|
-
// }, 300_000);
|
|
35
|
-
it('should be able to test github benchmarks', async () => {
|
|
36
|
-
// const intent = `Add the MCP server https://api.githubcopilot.com/mcp/ use the headers "Authorization: Bearer ${process.env.GITHUB_API_KEY}"`;
|
|
37
|
-
const intent = 'Add the linear mcp server with command "npx -y mcp-remote https://mcp.linear.app/sse"';
|
|
38
|
-
const response = await olaneOSInstance.use(oAddress.leader(), {
|
|
39
|
-
method: 'intent',
|
|
40
|
-
params: {
|
|
41
|
-
intent: intent,
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
console.log('Setup MCP server response:');
|
|
45
|
-
console.log(response.result.data);
|
|
46
|
-
// for (const testCase of GITHUB_TEST_CASES) {
|
|
47
|
-
// console.log(testCase.input);
|
|
48
|
-
// const handshakeResponse = await olaneOSInstance.use(oAddress.leader(), {
|
|
49
|
-
// method: 'intent',
|
|
50
|
-
// params: {
|
|
51
|
-
// intent: testCase.input,
|
|
52
|
-
// },
|
|
53
|
-
// });
|
|
54
|
-
// console.log(
|
|
55
|
-
// `Finished with ${(handshakeResponse.result.data as any).cycles} cycles`,
|
|
56
|
-
// );
|
|
57
|
-
// console.log(handshakeResponse.result.data);
|
|
58
|
-
// // const result = await testCase.output;
|
|
59
|
-
// // expect(result).to.contain(testCase.output.contains);
|
|
60
|
-
// }
|
|
61
|
-
}, 300000);
|
|
62
|
-
});
|
|
63
|
-
describe('basic-usage @stop-network', async () => {
|
|
64
|
-
it('should be able to stop the network', async () => {
|
|
65
|
-
await olaneOSInstance.stop();
|
|
66
|
-
expect(olaneOSInstance.status).to.equal(OlaneOSSystemStatus.STOPPED);
|
|
67
|
-
});
|
|
68
|
-
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@olane/os",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"url": "git+https://github.com/olane-labs/olane.git"
|
|
34
34
|
},
|
|
35
35
|
"author": "oLane Inc.",
|
|
36
|
-
"license": "
|
|
36
|
+
"license": "(MIT OR Apache-2.0)",
|
|
37
37
|
"description": "oLane OS basic implementation",
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@eslint/eslintrc": "^3.3.1",
|
|
@@ -58,16 +58,16 @@
|
|
|
58
58
|
"typescript": "5.4.5"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@olane/o-config": "^0.7.
|
|
62
|
-
"@olane/o-core": "^0.7.
|
|
63
|
-
"@olane/o-intelligence": "^0.7.
|
|
64
|
-
"@olane/o-lane": "^0.7.
|
|
65
|
-
"@olane/o-leader": "^0.7.
|
|
66
|
-
"@olane/o-protocol": "^0.7.
|
|
67
|
-
"@olane/o-storage": "^0.7.
|
|
68
|
-
"@olane/o-tool": "^0.7.
|
|
69
|
-
"@olane/o-tool-registry": "^0.7.
|
|
70
|
-
"@olane/o-tools-common": "^0.7.
|
|
61
|
+
"@olane/o-config": "^0.7.2",
|
|
62
|
+
"@olane/o-core": "^0.7.2",
|
|
63
|
+
"@olane/o-intelligence": "^0.7.2",
|
|
64
|
+
"@olane/o-lane": "^0.7.2",
|
|
65
|
+
"@olane/o-leader": "^0.7.2",
|
|
66
|
+
"@olane/o-protocol": "^0.7.2",
|
|
67
|
+
"@olane/o-storage": "^0.7.2",
|
|
68
|
+
"@olane/o-tool": "^0.7.2",
|
|
69
|
+
"@olane/o-tool-registry": "^0.7.2",
|
|
70
|
+
"@olane/o-tools-common": "^0.7.2"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
73
|
"chalk": "^5.4.1",
|