@olane/os 0.8.21 → 0.9.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.
@@ -1,3 +1,11 @@
1
1
  import { OlaneOSConfig } from '../interfaces/o-os.config.js';
2
- export declare const defaultOSInstanceConfig: (port: number) => OlaneOSConfig;
2
+ export interface DefaultOSInstanceConfigOptions {
3
+ /**
4
+ * Mount a circuit-relay-v2 RelayNode as a leader child so other peers
5
+ * can dial through this OS. Defaults to `true` — opt out by passing
6
+ * `{ enableRelay: false }` for headless server-side usage.
7
+ */
8
+ enableRelay?: boolean;
9
+ }
10
+ export declare const defaultOSInstanceConfig: (port: number, options?: DefaultOSInstanceConfigOptions) => OlaneOSConfig;
3
11
  //# sourceMappingURL=default.config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"default.config.d.ts","sourceRoot":"","sources":["../../../../src/o-olane-os/config/default.config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAG7D,eAAO,MAAM,uBAAuB,GAAI,MAAM,MAAM,KAAG,aAmCtD,CAAC"}
1
+ {"version":3,"file":"default.config.d.ts","sourceRoot":"","sources":["../../../../src/o-olane-os/config/default.config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAG7D,MAAM,WAAW,8BAA8B;IAC7C;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,uBAAuB,GAClC,MAAM,MAAM,EACZ,UAAS,8BAAmC,KAC3C,aAiDF,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { DEFAULT_INSTANCE_PATH, NodeType, oAddress } from '@olane/o-core';
2
2
  import * as path from 'path';
3
- export const defaultOSInstanceConfig = (port) => {
3
+ export const defaultOSInstanceConfig = (port, options = {}) => {
4
+ const { enableRelay = true } = options;
4
5
  return {
5
6
  configFilePath: path.join(DEFAULT_INSTANCE_PATH, 'my-olane-os', 'config.json'),
6
7
  network: {
@@ -27,6 +28,18 @@ export const defaultOSInstanceConfig = (port) => {
27
28
  leader: null,
28
29
  parent: null,
29
30
  },
31
+ ...(enableRelay
32
+ ? [
33
+ {
34
+ type: NodeType.NODE,
35
+ address: new oAddress('o://relay'),
36
+ description: 'circuit-relay-v2 server for the OS — other peers dial through this',
37
+ leader: null,
38
+ parent: null,
39
+ relay: true,
40
+ },
41
+ ]
42
+ : []),
30
43
  ],
31
44
  lanes: [],
32
45
  inProgress: [],
@@ -1 +1 @@
1
- {"version":3,"file":"o-os.d.ts","sourceRoot":"","sources":["../../../src/o-olane-os/o-os.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAK5D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAIzC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAI1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,KAAK,WAAW,GAAG,SAAS,GAAG,WAAW,CAAC;AAC3C,qBAAa,OAAQ,SAAQ,OAAO;IAClC,OAAO,CAAC,OAAO,CAAqB;IACpC,OAAO,CAAC,KAAK,CAAqB;IAC3B,UAAU,EAAE,WAAW,GAAG,IAAI,CAAQ;IACtC,MAAM,EAAG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AO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,UAAU,EAAE,CAAA;KAAE,CAAC;IA0C9D,IAAI;IAwBJ,OAAO;CAKd"}
@@ -18,6 +18,7 @@ import { MemoryHarness } from '../memory/memory-harness.js';
18
18
  import { CopassVectorStoreTool } from '../vector-store/copass-vector-store.tool.js';
19
19
  import { FilesystemTool } from '../tools/filesystem.tool.js';
20
20
  import { AgentRegistryNode } from '@olane/o-agent';
21
+ import { RelayNode } from '../nodes/relay-node.js';
21
22
  export class OlaneOS extends oObject {
22
23
  constructor(config) {
23
24
  super();
@@ -183,6 +184,29 @@ export class OlaneOS extends oObject {
183
184
  await initCommonTools(leaderNode);
184
185
  this.leaders.push(leaderNode);
185
186
  }
187
+ else if (node.relay === true) {
188
+ // Relay node — circuit-relay-v2 server. Mounted as a leader
189
+ // child so it lives at `o://relay` (or whatever address the
190
+ // config specifies) at the same hierarchy level as the
191
+ // o://fs / o://vector-store / o://world-manager services.
192
+ // The `relay` flag is declared in OSRelayNodeConfig
193
+ // (interfaces/o-os.config.ts:11) but was never wired —
194
+ // consumers like @copass/olane-agents had to spawn the OS
195
+ // and call `addNode(new RelayNode(...))` themselves, which
196
+ // attached the relay to a round-robin worker, not the leader.
197
+ this.logger.debug('Starting relay node: ' + node.address.toString());
198
+ const relayNode = new RelayNode({
199
+ ...node,
200
+ address: node.address,
201
+ leader: this.rootLeader?.address || null,
202
+ parent: this.rootLeader?.address || null,
203
+ });
204
+ relayNode.onInitFinished(() => {
205
+ this.rootLeader?.addChildNode(relayNode);
206
+ });
207
+ await relayNode.start();
208
+ this.nodes.push(relayNode);
209
+ }
186
210
  else {
187
211
  this.logger.debug('Starting non-leader node: ' + node.address.toString());
188
212
  const commonNode = new oLaneTool({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olane/os",
3
- "version": "0.8.21",
3
+ "version": "0.9.0",
4
4
  "type": "module",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
@@ -60,25 +60,25 @@
60
60
  },
61
61
  "dependencies": {
62
62
  "@libp2p/circuit-relay-v2": "^4.1.3",
63
- "@olane/o-agent": "0.8.21",
64
- "@olane/o-client-limited": "0.8.21",
65
- "@olane/o-config": "0.8.21",
66
- "@olane/o-core": "0.8.21",
67
- "@olane/o-intelligence": "0.8.21",
68
- "@olane/o-lane": "0.8.21",
69
- "@olane/o-leader": "0.8.21",
70
- "@olane/o-login": "0.8.21",
71
- "@olane/o-node": "0.8.21",
72
- "@olane/o-protocol": "0.8.21",
73
- "@olane/o-storage": "0.8.21",
74
- "@olane/o-tool": "0.8.21",
75
- "@olane/o-tool-registry": "0.8.21",
76
- "@olane/o-tools-common": "0.8.21",
63
+ "@olane/o-agent": "0.9.0",
64
+ "@olane/o-client-limited": "0.9.0",
65
+ "@olane/o-config": "0.9.0",
66
+ "@olane/o-core": "0.9.0",
67
+ "@olane/o-intelligence": "0.9.0",
68
+ "@olane/o-lane": "0.9.0",
69
+ "@olane/o-leader": "0.9.0",
70
+ "@olane/o-login": "0.9.0",
71
+ "@olane/o-node": "0.9.0",
72
+ "@olane/o-protocol": "0.9.0",
73
+ "@olane/o-storage": "0.9.0",
74
+ "@olane/o-tool": "0.9.0",
75
+ "@olane/o-tool-registry": "0.9.0",
76
+ "@olane/o-tools-common": "0.9.0",
77
77
  "chalk": "^5.6.2",
78
78
  "debug": "^4.4.3",
79
79
  "dotenv": "^17.3.1",
80
80
  "fs-extra": "^11.3.3",
81
81
  "touch": "^3.1.1"
82
82
  },
83
- "gitHead": "0af9a8e391261abef454d9423ee00288277c5a6c"
83
+ "gitHead": "70399c2311a2e34f02285a522a51a55faee62d65"
84
84
  }