@olane/os 0.7.12-alpha.27 → 0.7.12-alpha.29

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.
@@ -20,7 +20,7 @@ export declare class OlaneOS extends oObject {
20
20
  getOSInstanceName(): Promise<string | undefined>;
21
21
  startNodes(type: NodeType): Promise<void>;
22
22
  runSavedPlans(): Promise<void>;
23
- use(oAddress: oAddress, params: any): Promise<any>;
23
+ use(oAddress: oAddress, params: any): Promise<import("@olane/o-core").oResponse>;
24
24
  start(): Promise<{
25
25
  peerId: string;
26
26
  transports: oTransport[];
@@ -1,2 +1 @@
1
- export {};
2
1
  //# sourceMappingURL=basic-usage.spec.d.ts.map
@@ -1,130 +1,144 @@
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 } from '@olane/o-node';
7
- dotenv.config();
8
- const network = defaultOSInstance;
9
- describe('basic-usage @initialize', async () => {
10
- it('should be able to startup the network', async () => {
11
- await network.start();
12
- expect(network.status).to.equal(OlaneOSSystemStatus.RUNNING);
13
- });
14
- // disabled for now, to avoid unecessary indexing costs
15
- // it('should be able to index the network', async () => {
16
- // const entryNode = network.entryNode();
17
- // expect(entryNode).to.exist;
18
- // expect(entryNode.state).to.equal(NodeState.RUNNING);
19
- // const response = await entryNode.use(new oAddress('o://leader'), {
20
- // method: 'index_network',
21
- // params: {},
22
- // });
23
- // const data = response.result.data;
24
- // expect(data).to.exist;
25
- // expect(data.error).to.be.undefined;
26
- // expect(data.message).to.equal('Network indexed!');
27
- // });
28
- it('should be able to use stream from a provider service', async () => {
29
- const entryNode = network.entryNode();
30
- expect(entryNode).to.exist;
31
- expect(entryNode.state).to.equal(NodeState.RUNNING);
32
- // configure the intelligence tool
33
- // await entryNode.use(new oAddress('o://intelligence'), {
34
- // method: 'configure',
35
- // params: {
36
- // modelProvider: 'anthropic',
37
- // hostingProvider: 'olane',
38
- // accessToken: 'test',
39
- // address: 'o://leader/intelligence',
40
- // },
41
- // });
42
- // use the intelligence tool
43
- await entryNode.useStream(new oNodeAddress('o://leader'), {
44
- method: 'intent',
45
- params: {
46
- _isStream: true,
47
- intent: 'What is the official endpoint for github mcp server?',
48
- },
49
- }, {
50
- onChunk: (chunk) => {
51
- console.log('Received chunk: ', JSON.stringify(chunk.result.data, null, 2));
52
- },
53
- });
54
- // await entryNode.use(
55
- // new oNodeAddress('o://intelligence'),
56
- // {
57
- // method: 'prompt',
58
- // params: {
59
- // _isStream: true,
60
- // prompt: 'What is the capital of France?',
61
- // },
62
- // },
63
- // {
64
- // isStream: true,
65
- // onChunk: (chunk) => {
66
- // console.log('FINAL Received chunk: ', JSON.stringify(chunk, null, 2));
67
- // },
68
- // },
69
- // );
70
- // await new Promise((resolve) => setTimeout(resolve, 20_000));
71
- });
72
- });
73
- // describe('olane network usage', async () => {
74
- // it('should be able to use the olane network', async () => {
75
- // // let's dial the other network
76
- // const response = await network.use(
77
- // new oAddress('o://leader', [
78
- // multiaddr('/dns4/leader.olane.com/tcp/4000/tls/ws'),
79
- // ]),
1
+ "use strict";
2
+ // import { oAddress, NodeState } from '@olane/o-core';
3
+ // import { expect } from 'chai';
4
+ // import dotenv from 'dotenv';
5
+ // import { defaultOSInstance } from '../utils/os.default.js';
6
+ // import { OlaneOSSystemStatus } from '../../src/o-olane-os/enum/o-os.status-enum.js';
7
+ // import { oNodeAddress, oNodeTransport } from '@olane/o-node';
8
+ // import { multiaddr } from '@olane/o-config';
9
+ // dotenv.config();
10
+ // const network = defaultOSInstance;
11
+ // describe('basic-usage @initialize', async () => {
12
+ // it('should be able to startup the network', async () => {
13
+ // await network.start();
14
+ // expect(network.status).to.equal(OlaneOSSystemStatus.RUNNING);
15
+ // });
16
+ // // disabled for now, to avoid unecessary indexing costs
17
+ // // it('should be able to index the network', async () => {
18
+ // // const entryNode = network.entryNode();
19
+ // // expect(entryNode).to.exist;
20
+ // // expect(entryNode.state).to.equal(NodeState.RUNNING);
21
+ // // const response = await entryNode.use(new oAddress('o://leader'), {
22
+ // // method: 'index_network',
23
+ // // params: {},
24
+ // // });
25
+ // // const data = response.result.data;
26
+ // // expect(data).to.exist;
27
+ // // expect(data.error).to.be.undefined;
28
+ // // expect(data.message).to.equal('Network indexed!');
29
+ // // });
30
+ // it('should be able to use stream from a provider service', async () => {
31
+ // const entryNode = network.entryNode();
32
+ // expect(entryNode).to.exist;
33
+ // expect(entryNode.state).to.equal(NodeState.RUNNING);
34
+ // // configure the intelligence tool
35
+ // // await entryNode.use(new oAddress('o://intelligence'), {
36
+ // // method: 'configure',
37
+ // // params: {
38
+ // // modelProvider: 'anthropic',
39
+ // // hostingProvider: 'olane',
40
+ // // accessToken: 'test',
41
+ // // address: 'o://leader/intelligence',
42
+ // // },
43
+ // // });
44
+ // // console.log('Pinging relay');
45
+ // // await (entryNode.p2pNode.services as any).ping.ping(
46
+ // // multiaddr('/dns4/relay.olane.com/tcp/4000/tls/ws'),
47
+ // // );
48
+ // console.log('Pinged relay');
49
+ // // use the intelligence tool
50
+ // await entryNode.useStream(
51
+ // new oNodeAddress('o://leader', [new oNodeTransport('/ip4/127.0.0.1/tcp/4000/ws/p2p/12D3KooWPHdsHhEdyBd9DS2zHJ1vRSyqSkZ97iT7F8ByYJ7U7bw8')]),
80
52
  // {
81
53
  // method: 'intent',
82
54
  // params: {
83
- // intent: 'What can I do?',
55
+ // _isStream: true,
56
+ // intent: 'What is the official endpoint for github mcp server?',
84
57
  // },
85
58
  // },
86
- // );
87
- // console.log(response.result.data);
88
- // });
89
- // });
90
- // describe('external-networks', async () => {
91
- // it('should be able to use an external network', async () => {
92
- // const network2 = new oNetwork({
93
- // // configFilePath: path.join(os.homedir(), '.olane', 'config.json'),
94
- // nodes: [
95
- // {
96
- // type: NodeType.LEADER,
97
- // address: new oAddress('o://leader'),
98
- // leader: null,
99
- // parent: null,
100
- // },
101
- // {
102
- // type: NodeType.NODE,
103
- // address: new oAddress('o://node2'),
104
- // leader: null,
105
- // parent: null,
106
- // },
107
- // ],
108
- // plans: [],
109
- // noIndexNetwork: true,
110
- // });
111
- // await network2.start();
112
- // expect(network2.status).to.equal(NetworkStatus.RUNNING);
113
- // // let's dial the other network
114
- // await network2.use(
115
- // new oAddress('o://leader', [
116
- // ...(network?.rootLeader?.address.libp2pTransports || []),
117
- // ]),
118
59
  // {
119
- // method: 'index_network',
120
- // params: {},
60
+ // onChunk: (chunk) => {
61
+ // console.log(
62
+ // 'Received chunk: ',
63
+ // JSON.stringify(chunk.result.data, null, 2),
64
+ // );
65
+ // },
121
66
  // },
122
67
  // );
68
+ // // await entryNode.use(
69
+ // // new oNodeAddress('o://intelligence'),
70
+ // // {
71
+ // // method: 'prompt',
72
+ // // params: {
73
+ // // _isStream: true,
74
+ // // prompt: 'What is the capital of France?',
75
+ // // },
76
+ // // },
77
+ // // {
78
+ // // isStream: true,
79
+ // // onChunk: (chunk) => {
80
+ // // console.log('FINAL Received chunk: ', JSON.stringify(chunk, null, 2));
81
+ // // },
82
+ // // },
83
+ // // );
84
+ // // await new Promise((resolve) => setTimeout(resolve, 20_000));
85
+ // });
86
+ // });
87
+ // // describe('olane network usage', async () => {
88
+ // // it('should be able to use the olane network', async () => {
89
+ // // // let's dial the other network
90
+ // // const response = await network.use(
91
+ // // new oAddress('o://leader', [
92
+ // // multiaddr('/dns4/leader.olane.com/tcp/4000/tls/ws'),
93
+ // // ]),
94
+ // // {
95
+ // // method: 'intent',
96
+ // // params: {
97
+ // // intent: 'What can I do?',
98
+ // // },
99
+ // // },
100
+ // // );
101
+ // // console.log(response.result.data);
102
+ // // });
103
+ // // });
104
+ // // describe('external-networks', async () => {
105
+ // // it('should be able to use an external network', async () => {
106
+ // // const network2 = new oNetwork({
107
+ // // // configFilePath: path.join(os.homedir(), '.olane', 'config.json'),
108
+ // // nodes: [
109
+ // // {
110
+ // // type: NodeType.LEADER,
111
+ // // address: new oAddress('o://leader'),
112
+ // // leader: null,
113
+ // // parent: null,
114
+ // // },
115
+ // // {
116
+ // // type: NodeType.NODE,
117
+ // // address: new oAddress('o://node2'),
118
+ // // leader: null,
119
+ // // parent: null,
120
+ // // },
121
+ // // ],
122
+ // // plans: [],
123
+ // // noIndexNetwork: true,
124
+ // // });
125
+ // // await network2.start();
126
+ // // expect(network2.status).to.equal(NetworkStatus.RUNNING);
127
+ // // // let's dial the other network
128
+ // // await network2.use(
129
+ // // new oAddress('o://leader', [
130
+ // // ...(network?.rootLeader?.address.libp2pTransports || []),
131
+ // // ]),
132
+ // // {
133
+ // // method: 'index_network',
134
+ // // params: {},
135
+ // // },
136
+ // // );
137
+ // // });
138
+ // // });
139
+ // describe('basic-usage @stop-network', async () => {
140
+ // it('should be able to stop the network', async () => {
141
+ // await network.stop();
142
+ // expect(network.status).to.equal(OlaneOSSystemStatus.STOPPED);
123
143
  // });
124
144
  // });
125
- describe('basic-usage @stop-network', async () => {
126
- it('should be able to stop the network', async () => {
127
- await network.stop();
128
- expect(network.status).to.equal(OlaneOSSystemStatus.STOPPED);
129
- });
130
- });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=playground.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playground.spec.d.ts","sourceRoot":"","sources":["../../../test/basic/playground.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,33 @@
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 { oNodeAddress, oNodeTransport } from '@olane/o-node';
6
+ import { tmpNode } from '../utils/tmp.node.js';
7
+ dotenv.config();
8
+ const network = defaultOSInstance;
9
+ describe('playground running', async () => {
10
+ it('should be able to use stream from a provider service', async () => {
11
+ const entryNode = tmpNode;
12
+ await entryNode.start();
13
+ expect(entryNode).to.exist;
14
+ expect(entryNode.state).to.equal(NodeState.RUNNING);
15
+ console.log('Using intelligence tool');
16
+ const response = await entryNode.useStream(new oNodeAddress('o://leader/auth/services/intelligence', [
17
+ new oNodeTransport('/ip4/127.0.0.1/tcp/4000/ws/p2p/12D3KooWPHdsHhEdyBd9DS2zHJ1vRSyqSkZ97iT7F8ByYJ7U7bw8'),
18
+ ]), {
19
+ method: 'prompt',
20
+ params: {
21
+ _isStream: true,
22
+ prompt: 'What is the capital of France?',
23
+ _token: 'test',
24
+ },
25
+ }, {
26
+ onChunk: (chunk) => {
27
+ console.log('Received chunk:', JSON.stringify(chunk.result.data, null, 2));
28
+ },
29
+ });
30
+ console.log('Response:', response.result.data);
31
+ await entryNode.stop();
32
+ });
33
+ });
@@ -0,0 +1,3 @@
1
+ import { oLaneTool } from '@olane/o-lane';
2
+ export declare const tmpNode: oLaneTool;
3
+ //# sourceMappingURL=tmp.node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tmp.node.d.ts","sourceRoot":"","sources":["../../../test/utils/tmp.node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG1C,eAAO,MAAM,OAAO,WAKlB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { oLaneTool } from '@olane/o-lane';
2
+ import { oNodeAddress } from '@olane/o-node';
3
+ export const tmpNode = new oLaneTool({
4
+ address: new oNodeAddress('o://tmp-node'),
5
+ leader: null,
6
+ parent: null,
7
+ description: 'temporary node',
8
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olane/os",
3
- "version": "0.7.12-alpha.27",
3
+ "version": "0.7.12-alpha.29",
4
4
  "type": "module",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
@@ -57,21 +57,21 @@
57
57
  "typescript": "5.4.5"
58
58
  },
59
59
  "dependencies": {
60
- "@olane/o-config": "0.7.12-alpha.27",
61
- "@olane/o-core": "0.7.12-alpha.27",
62
- "@olane/o-intelligence": "0.7.12-alpha.27",
63
- "@olane/o-lane": "0.7.12-alpha.27",
64
- "@olane/o-leader": "0.7.12-alpha.27",
65
- "@olane/o-protocol": "0.7.12-alpha.27",
66
- "@olane/o-storage": "0.7.12-alpha.27",
67
- "@olane/o-tool": "0.7.12-alpha.27",
68
- "@olane/o-tool-registry": "0.7.12-alpha.27",
69
- "@olane/o-tools-common": "0.7.12-alpha.27",
60
+ "@olane/o-config": "0.7.12-alpha.29",
61
+ "@olane/o-core": "0.7.12-alpha.29",
62
+ "@olane/o-intelligence": "0.7.12-alpha.29",
63
+ "@olane/o-lane": "0.7.12-alpha.29",
64
+ "@olane/o-leader": "0.7.12-alpha.29",
65
+ "@olane/o-protocol": "0.7.12-alpha.29",
66
+ "@olane/o-storage": "0.7.12-alpha.29",
67
+ "@olane/o-tool": "0.7.12-alpha.29",
68
+ "@olane/o-tool-registry": "0.7.12-alpha.29",
69
+ "@olane/o-tools-common": "0.7.12-alpha.29",
70
70
  "chalk": "^5.4.1",
71
71
  "debug": "^4.4.1",
72
72
  "dotenv": "^16.5.0",
73
73
  "fs-extra": "^11.3.0",
74
74
  "touch": "^3.1.1"
75
75
  },
76
- "gitHead": "e6f6db738660a7556bd3e7efd2bcd6f69d30af7c"
76
+ "gitHead": "b8c692a1b5ef2d0e974ccfe501841be852b17dbc"
77
77
  }