@olane/o-core 0.1.6 → 0.2.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.
@@ -10,7 +10,7 @@ import { oConnection } from './lib/o-connection.js';
10
10
  import { oMethod } from '@olane/o-protocol';
11
11
  import { oAddressResolution } from './lib/o-address-resolution.js';
12
12
  import { oDependency } from './o-dependency.js';
13
- import { UseOptions } from './interfaces/use-options.interface.js';
13
+ import { CID } from 'multiformats';
14
14
  export declare abstract class oCoreNode {
15
15
  readonly config: CoreConfig;
16
16
  p2pNode: Libp2p;
@@ -37,6 +37,7 @@ export declare abstract class oCoreNode {
37
37
  initialize(): Promise<void>;
38
38
  whoami(): Promise<any>;
39
39
  get parent(): oAddress | null;
40
+ get parentPeerId(): string | null;
40
41
  get parentTransports(): Multiaddr[];
41
42
  getTransports(address: oAddress): Multiaddr[];
42
43
  handleStaticAddressTranslation(addressInput: oAddress): Promise<oAddress>;
@@ -56,9 +57,10 @@ export declare abstract class oCoreNode {
56
57
  params?: {
57
58
  [key: string]: any;
58
59
  };
59
- }, config?: UseOptions): Promise<oResponse>;
60
+ }): Promise<oResponse>;
61
+ advertiseValueToNetwork(value: CID): Promise<void>;
60
62
  advertiseToNetwork(): Promise<void>;
61
- connectToParent(): Promise<void>;
63
+ unregister(): Promise<void>;
62
64
  register(): Promise<void>;
63
65
  connect(nextHopAddress: oAddress, targetAddress: oAddress): Promise<oConnection>;
64
66
  teardown(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"core.node.d.ts","sourceRoot":"","sources":["../../src/core/core.node.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EACN,YAAY,EACZ,SAAS,EAET,MAAM,EACP,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,g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  return this.config.parent || null;
50
50
  }
51
+ get parentPeerId() {
52
+ if (!this.parent || this.parent?.transports?.length === 0) {
53
+ return null;
54
+ }
55
+ const transport = this.parent?.transports[0];
56
+ const peerId = transport.toString().split('/p2p/')[1];
57
+ return peerId;
58
+ }
51
59
  get parentTransports() {
52
60
  return this.parent?.transports.map((t) => multiaddr(t)) || [];
53
61
  }
@@ -89,8 +97,6 @@ export class oCoreNode {
89
97
  const response = await this.use(new oAddress('o://leader/register', result.transports), {
90
98
  method: 'search',
91
99
  params: { staticAddress: result.root },
92
- }, {
93
- noIndex: true,
94
100
  });
95
101
  const searchResults = response.result.data;
96
102
  if (searchResults.length > 0) {
@@ -127,7 +133,7 @@ export class oCoreNode {
127
133
  * @param config
128
134
  * @returns
129
135
  */
130
- async use(addressWithLeaderTransports, data, config = {}) {
136
+ async use(addressWithLeaderTransports, data) {
131
137
  const { nextHopAddress, targetAddress } = await this.translateAddress(addressWithLeaderTransports);
132
138
  this.logger.debug('Using address: ', targetAddress.toString());
133
139
  const connection = await this.connect(nextHopAddress, targetAddress);
@@ -138,6 +144,11 @@ export class oCoreNode {
138
144
  });
139
145
  return response;
140
146
  }
147
+ async advertiseValueToNetwork(value) {
148
+ const providePromise = this.p2pNode.services.dht.provide(value);
149
+ const timeoutPromise = new Promise((_, reject) => setTimeout(() => reject(new Error('Advertise Content routing provide timeout')), 5000));
150
+ await Promise.race([providePromise, timeoutPromise]);
151
+ }
141
152
  async advertiseToNetwork() {
142
153
  this.logger.debug('Advertising to network our static and absolute addresses...');
143
154
  // advertise the absolute address to the network with timeout
@@ -145,10 +156,8 @@ export class oCoreNode {
145
156
  this.logger.debug('Advertising absolute address: ', absoluteAddressCid);
146
157
  try {
147
158
  // Add timeout to prevent hanging
148
- const providePromise = this.p2pNode.services.dht.provide(absoluteAddressCid);
149
- const timeoutPromise = new Promise((_, reject) => setTimeout(() => reject(new Error('Advertise Content routing provide timeout')), 5000));
150
- await Promise.race([providePromise, timeoutPromise]);
151
- this.logger.debug('Successfully advertised absolute address', providePromise);
159
+ await this.advertiseValueToNetwork(absoluteAddressCid);
160
+ this.logger.debug('Successfully advertised absolute address');
152
161
  }
153
162
  catch (error) {
154
163
  this.logger.warn('Failed to advertise absolute address (this is normal for isolated nodes):', error.message);
@@ -158,29 +167,23 @@ export class oCoreNode {
158
167
  this.logger.debug('Advertising static address: ', staticAddressCid);
159
168
  try {
160
169
  // Add timeout to prevent hanging
161
- const providePromise = this.p2pNode.services.dht.provide(staticAddressCid);
162
- const timeoutPromise = new Promise((_, reject) => setTimeout(() => reject(new Error('Content routing provide timeout')), 5000));
163
- await Promise.race([providePromise, timeoutPromise]);
170
+ await this.advertiseValueToNetwork(staticAddressCid);
164
171
  this.logger.debug('Successfully advertised static address');
165
172
  }
166
173
  catch (error) {
167
174
  this.logger.warn('Failed to advertise static address (this is normal for isolated nodes):', error.message);
168
175
  }
169
176
  }
170
- async connectToParent() {
171
- // ensure we have modified the address to be a child address if the parent address is provided
172
- if (this.parent) {
173
- this.logger.debug('Connecting to parent: ' + this.parent.toString());
174
- await this.connect(this.parent, this.parent);
175
- // this.address = CoreUtils.childAddress(this.parentAddress, this.address);
176
- // await new Promise((resolve) => setTimeout(resolve, 1_000));
177
- // this.logger.debug('Modified address to: ' + this.address.toString());
178
- // TODO: let's ask the parent to route us to the leader
179
- this.logger.debug('Successfully connected to parent');
180
- }
181
- else {
182
- this.logger.debug('Node not configured to connect to parent or has already connected to the parent');
183
- }
177
+ async unregister() {
178
+ const address = new oAddress('o://register');
179
+ // attempt to unregister from the network
180
+ const params = {
181
+ method: 'remove',
182
+ params: {
183
+ peerId: this.peerId.toString(),
184
+ },
185
+ };
186
+ await this.use(address, params);
184
187
  }
185
188
  async register() {
186
189
  if (this.type === NodeType.LEADER) {
@@ -188,14 +191,12 @@ export class oCoreNode {
188
191
  return;
189
192
  }
190
193
  this.logger.debug('Registering node...');
191
- // connect to the parent node to establish identity
192
- await this.connectToParent();
193
194
  // register with the leader global registry
194
195
  if (!this.config.leader) {
195
196
  this.logger.warn('No leaders found, skipping registration');
196
197
  return;
197
198
  }
198
- const address = new oAddress('o://leader/register');
199
+ const address = new oAddress('o://register');
199
200
  const params = {
200
201
  method: 'commit',
201
202
  params: {
@@ -206,9 +207,7 @@ export class oCoreNode {
206
207
  staticAddress: this.staticAddress.toString(),
207
208
  },
208
209
  };
209
- await this.use(address, params, {
210
- noIndex: true,
211
- });
210
+ await this.use(address, params);
212
211
  // TODO: handle the response from the leader
213
212
  }
214
213
  async connect(nextHopAddress, targetAddress) {
@@ -237,6 +236,8 @@ export class oCoreNode {
237
236
  }
238
237
  async teardown() {
239
238
  this.logger.debug('Tearing down node...');
239
+ // TODO: improve this with a network listener from parent
240
+ await this.unregister();
240
241
  if (this.p2pNode) {
241
242
  await this.p2pNode.stop();
242
243
  }
@@ -2,5 +2,4 @@ export * from './core-config.interface.js';
2
2
  export * from './node-type.enum.js';
3
3
  export * from './restricted-addresses.enum.js';
4
4
  export * from './state.enum.js';
5
- export * from './use-options.interface.js';
6
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iBAAiB,CAAC"}
@@ -2,4 +2,3 @@ export * from './core-config.interface.js';
2
2
  export * from './node-type.enum.js';
3
3
  export * from './restricted-addresses.enum.js';
4
4
  export * from './state.enum.js';
5
- export * from './use-options.interface.js';
@@ -22,6 +22,7 @@ export declare abstract class oNode extends oCoreNode {
22
22
  * @returns
23
23
  */
24
24
  _tool_intent(request: oRequest): Promise<any>;
25
+ _tool_child_register(request: oRequest): Promise<any>;
25
26
  start(): Promise<void>;
26
27
  startChildren(): Promise<void>;
27
28
  validateJoinRequest(request: oRequest): Promise<any>;
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/node/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,YAAY,EAKZ,MAAM,EACP,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAIL,QAAQ,EAER,SAAS,EACT,QAAQ,EACR,SAAS,EACV,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAKhE,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAUhE,8BAAsB,KAAM,SAAQ,SAAS;IACpC,eAAe,EAAG,eAAe,CAAC;IAClC,UAAU,EAAE,KAAK,EAAE,CAAM;IACzB,cAAc,EAAE,QAAQ,EAAE,CAAM;IAEvC,QAAQ,IAAI,IAAI;IAMV,eAAe,CAAC,SAAS,EAAE,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC;IAyBhE,QAAQ,CAAC,mBAAmB,IAAI,GAAG,EAAE;IAErC,OAAO,IAAI,MAAM,EAAE;IAMb,qBAAqB,CACzB,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,QAAQ,GAChB,OAAO,CAAC,SAAS,CAAC;IAOrB,mBAAmB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO;IAQ/C,aAAa,CAAC,OAAO,EAAE,QAAQ,GAAG,MAAM;IAIlC,WAAW,CAAC,OAAO,EAAE,QAAQ,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IAqEvE;;;;OAIG;IACG,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IA2B7C,KAAK,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AAO,EAAE,QAAQ,GAAG,OAAO;IAQ/C,aAAa,CAAC,OAAO,EAAE,QAAQ,GAAG,MAAM;IAIlC,WAAW,CAAC,OAAO,EAAE,QAAQ,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IAgEvE;;;;OAIG;IACG,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IA2B7C,oBAAoB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IASrD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAOtB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IA2C9B,mBAAmB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IAIpD,eAAe,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IAYtD,YAAY,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI;IAK/B,eAAe,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI;IAIlC;;;OAGG;IACG,SAAS,IAAI,OAAO,CAAC,YAAY,CAAC;IA2ElC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAyBjC,sBAAsB;IAIhB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAOhC"}
package/dist/node/node.js CHANGED
@@ -1,16 +1,13 @@
1
- import { createNode, defaultLibp2pConfig, multiaddr, pipe, pushable, } from '@olane/o-config';
1
+ import { bootstrap, createNode, defaultLibp2pConfig, multiaddr, pipe, pushable, } from '@olane/o-config';
2
2
  import { CoreUtils, NodeState, NodeType, oAddress, oConnectionManager, oCoreNode, oRequest, } from '../core/index.js';
3
3
  import { v4 as uuidv4 } from 'uuid';
4
4
  import { NextHopResolver } from '../core/lib/resolvers/next-hop.resolver.js';
5
- import { register } from 'prom-client';
6
5
  import { NetworkActivity } from './lib/network-activity.lib.js';
7
6
  import { oToolError } from '../error/tool.error.js';
8
7
  import { oToolErrorCodes } from '../error/enums/codes.error.js';
9
8
  import { oAgentPlan } from '../plan/agent.plan.js';
10
9
  import { oPlanContext } from '../plan/plan.context.js';
11
10
  import { oConfigurePlan } from '../plan/configure/configure.plan.js';
12
- const started = false;
13
- const sharedRegistry = register;
14
11
  // Enable default Node.js metrics
15
12
  // collectDefaultMetrics({ register: sharedRegistry });
16
13
  export class oNode extends oCoreNode {
@@ -63,10 +60,6 @@ export class oNode extends oCoreNode {
63
60
  }
64
61
  async _tool_route(request) {
65
62
  const { payload } = request.params;
66
- const counter = this.p2pNode.metrics?.registerCounter('tool_route_count', {
67
- help: 'Number of tool routes',
68
- });
69
- counter?.increment();
70
63
  const { address } = request.params;
71
64
  const destinationAddress = new oAddress(address);
72
65
  // determine the next hop address from the encapsulated address
@@ -143,6 +136,14 @@ export class oNode extends oCoreNode {
143
136
  }),
144
137
  };
145
138
  }
139
+ async _tool_child_register(request) {
140
+ const { address } = request.params;
141
+ const childAddress = new oAddress(address);
142
+ this.childAddresses.push(childAddress);
143
+ return {
144
+ message: 'Child node registered with parent!',
145
+ };
146
+ }
146
147
  async start() {
147
148
  await super.start();
148
149
  await this.startChildren();
@@ -168,9 +169,12 @@ export class oNode extends oCoreNode {
168
169
  // node.address = CoreUtils.childAddress(this.address, node.address);
169
170
  this.logger.debug('Starting virtual node: ' +
170
171
  node.address.toString() +
171
- ' with leader transports: ' +
172
- node.config.leader?.transports.join(', '));
172
+ ' with parent transports: ' +
173
+ node.parentTransports.join(', '));
173
174
  await node.start();
175
+ this.logger.debug('Node started with transports: ', node.transports);
176
+ // test the connection to the child node to add it to the p2p network peer store
177
+ await this.connect(node.address, node.address);
174
178
  }
175
179
  catch (error) {
176
180
  this.logger.error('Failed to start virtual node: ' + node.address.toString(), error);
@@ -208,13 +212,6 @@ export class oNode extends oCoreNode {
208
212
  defaultLibp2pConfig.listeners ||
209
213
  []).concat(`/memory/${uuidv4()}`), // ensure we allow for local in-memory communication
210
214
  };
211
- // TODO: remove this once we have a proper metrics system
212
- if (!started) {
213
- // this.logger.debug('Enabling metrics');
214
- // params.metrics = prometheusMetrics({
215
- // registry: sharedRegistry,
216
- // });
217
- }
218
215
  // if the seed is provided, use it to generate the private key
219
216
  if (this.config.seed) {
220
217
  const privateKey = await CoreUtils.generatePrivateKey(this.config.seed);
@@ -231,60 +228,33 @@ export class oNode extends oCoreNode {
231
228
  this.leaders = leaderTransports;
232
229
  }
233
230
  // this is a child node of the network, so communication is heavily restricted
234
- // if (this.parentTransports.length > 0) {
235
- // // peer discovery is only allowed through the parent transports
236
- // params.peerDiscovery = [
237
- // bootstrap({
238
- // list: [...this.parentTransports.map((t) => t.toString())],
239
- // }),
240
- // ...(defaultLibp2pConfig.peerDiscovery || []),
241
- // ];
242
- // // // let's make sure we only allow communication through the parent transports
243
- // params.connectionGater = {
244
- // // deny all inbound connections unless they are from a parent transport
245
- // denyInboundConnection: (maConn) => {
246
- // if (this.parentTransports.includes(maConn.remoteAddr)) {
247
- // return false;
248
- // }
249
- // return this.config.type === NodeType.NODE; // allow leader inbounds
250
- // },
251
- // // TODO: [SECURITY] we need to manage outbount connections eventually
252
- // denyOutboundConnection: (peerId, maConn) => {
253
- // return false; // allow for now
254
- // },
255
- // denyDialMultiaddr: (multiaddr) => {
256
- // // Do not dial to any address that is not a leader transport
257
- // if (leaderTransports) {
258
- // const proxyAddresses = leaderTransports;
259
- // const shouldBlock = !proxyAddresses.some((addr) =>
260
- // multiaddr.toString().includes(addr.toString()),
261
- // );
262
- // if (shouldBlock) {
263
- // this.logger.debug(
264
- // 'Dialing to ' + multiaddr.toString() + ' blocked!',
265
- // );
266
- // } else {
267
- // this.logger.debug(
268
- // 'Dialing to ' + multiaddr.toString() + ' allowed!',
269
- // );
270
- // }
271
- // return !shouldBlock;
272
- // }
273
- // return false;
274
- // },
275
- // // allow the user to override the default connection gater
276
- // ...(this.config.network?.connectionGater || {}),
277
- // };
278
- // } else {
279
- // // this is either a leader or a single node network
280
- // // params.connectionGater = {
281
- // // denyInboundConnection: (maConn) => {
282
- // // return true;
283
- // // },
284
- // // // allow the user to override the default connection gater
285
- // // ...(this.config.network?.connectionGater || {}),
286
- // // };
287
- // }
231
+ if (this.parentTransports.length > 0) {
232
+ // peer discovery is only allowed through the parent transports
233
+ params.peerDiscovery = [
234
+ bootstrap({
235
+ list: [...this.parentTransports.map((t) => t.toString())],
236
+ }),
237
+ ...(defaultLibp2pConfig.peerDiscovery || []),
238
+ ];
239
+ // // let's make sure we only allow communication through the parent transports
240
+ params.connectionGater = {
241
+ // who can call us?
242
+ denyInboundEncryptedConnection: (peerId, maConn) => {
243
+ // deny all inbound connections unless they are from a parent transport
244
+ if (this.parentPeerId === peerId.toString()) {
245
+ return false;
246
+ }
247
+ // allow leader inbounds
248
+ if (this.config.type === NodeType.LEADER) {
249
+ return false;
250
+ }
251
+ // deny everything else
252
+ return true;
253
+ },
254
+ // allow the user to override the default connection gater
255
+ ...(this.config.network?.connectionGater || {}),
256
+ };
257
+ }
288
258
  // handle the address encapsulation
289
259
  if (this.config.leader &&
290
260
  !this.address.protocol.includes(this.config.leader.protocol)) {
@@ -299,6 +269,7 @@ export class oNode extends oCoreNode {
299
269
  this.validate();
300
270
  const params = await this.configure();
301
271
  this.p2pNode = await createNode(params);
272
+ this.logger.debug('Node initialized!', this.transports);
302
273
  this.address.setTransports(this.transports.map((t) => multiaddr(t)));
303
274
  this.peerId = this.p2pNode.peerId;
304
275
  // initialize connection manager
@@ -310,229 +281,6 @@ export class oNode extends oCoreNode {
310
281
  this.addressResolution.addResolver(new NextHopResolver(this.address, this.p2pNode));
311
282
  // listen for network events
312
283
  // this.listenForNetworkEvents();
313
- // if (this.type === NodeType.LEADER && (this.config.metrics || true)) {
314
- // try {
315
- // console.log('Starting metrics server...');
316
- // if (started === false) {
317
- // started = true;
318
- // const server = createServer(async (req, res) => {
319
- // try {
320
- // const url = new URL(req.url || '', `http://${req.headers.host}`);
321
- // const pathname = url.pathname;
322
- // // Set CORS headers for Grafana
323
- // res.setHeader('Access-Control-Allow-Origin', '*');
324
- // res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS');
325
- // res.setHeader('Access-Control-Allow-Headers', 'Content-Type');
326
- // // Handle OPTIONS requests (CORS preflight)
327
- // if (req.method === 'OPTIONS') {
328
- // res.writeHead(200);
329
- // res.end();
330
- // return;
331
- // }
332
- // // Prometheus API endpoints
333
- // if (pathname === '/api/v1/query') {
334
- // const query = url.searchParams.get('query');
335
- // const time = url.searchParams.get('time');
336
- // if (!query) {
337
- // res.writeHead(400, { 'Content-Type': 'application/json' });
338
- // res.end(JSON.stringify({ error: 'Missing query parameter' }));
339
- // return;
340
- // }
341
- // try {
342
- // // Get all metrics from the registry
343
- // const metrics = await sharedRegistry.getMetricsAsJSON();
344
- // // Simple query parser for basic PromQL-like queries
345
- // let result;
346
- // if (query === '1+1') {
347
- // // Handle simple scalar queries
348
- // result = {
349
- // resultType: 'scalar',
350
- // result: [
351
- // time ? parseInt(time) : Math.floor(Date.now() / 1000),
352
- // '2',
353
- // ],
354
- // };
355
- // } else if (query.includes('{')) {
356
- // // Handle metric queries with labels
357
- // const metricName = query.split('{')[0].trim();
358
- // const metric = metrics.find((m) => m.name === metricName);
359
- // if (metric) {
360
- // result = {
361
- // resultType: 'vector',
362
- // result: [
363
- // {
364
- // metric: { __name__: metricName },
365
- // value: [
366
- // time
367
- // ? parseInt(time)
368
- // : Math.floor(Date.now() / 1000),
369
- // String(metric.values[0]?.value || '0'),
370
- // ],
371
- // },
372
- // ],
373
- // };
374
- // } else {
375
- // result = {
376
- // resultType: 'vector',
377
- // result: [],
378
- // };
379
- // }
380
- // } else {
381
- // // Handle simple metric name queries
382
- // const metric = metrics.find((m) => m.name === query);
383
- // if (metric) {
384
- // result = {
385
- // resultType: 'vector',
386
- // result: [
387
- // {
388
- // metric: { __name__: query },
389
- // value: [
390
- // time
391
- // ? parseInt(time)
392
- // : Math.floor(Date.now() / 1000),
393
- // String(metric.values[0]?.value || '0'),
394
- // ],
395
- // },
396
- // ],
397
- // };
398
- // } else {
399
- // result = {
400
- // resultType: 'vector',
401
- // result: [],
402
- // };
403
- // }
404
- // }
405
- // res.writeHead(200, { 'Content-Type': 'application/json' });
406
- // res.end(
407
- // JSON.stringify({
408
- // status: 'success',
409
- // data: result,
410
- // }),
411
- // );
412
- // } catch (error) {
413
- // this.logger.error('Error executing Prometheus query:', error);
414
- // res.writeHead(400, { 'Content-Type': 'application/json' });
415
- // res.end(
416
- // JSON.stringify({
417
- // status: 'error',
418
- // errorType: 'bad_data',
419
- // error: error.message,
420
- // }),
421
- // );
422
- // }
423
- // return;
424
- // }
425
- // // Prometheus range query endpoint (for time series)
426
- // if (pathname === '/api/v1/query_range') {
427
- // const query = url.searchParams.get('query');
428
- // const start = url.searchParams.get('start');
429
- // const end = url.searchParams.get('end');
430
- // const step = url.searchParams.get('step');
431
- // if (!query || !start || !end || !step) {
432
- // res.writeHead(400, { 'Content-Type': 'application/json' });
433
- // res.end(
434
- // JSON.stringify({ error: 'Missing required parameters' }),
435
- // );
436
- // return;
437
- // }
438
- // try {
439
- // // For range queries, return current metric value as a single point
440
- // // In a real implementation, you'd want to store historical data
441
- // const metrics = await sharedRegistry.getMetricsAsJSON();
442
- // const metricName = query.split('{')[0].trim();
443
- // const metric = metrics.find((m) => m.name === metricName);
444
- // const result = {
445
- // resultType: 'matrix',
446
- // result: metric
447
- // ? [
448
- // {
449
- // metric: { __name__: metricName },
450
- // values: [
451
- // [
452
- // Math.floor(Date.now() / 1000),
453
- // String(metric.values[0]?.value || '0'),
454
- // ],
455
- // ],
456
- // },
457
- // ]
458
- // : [],
459
- // };
460
- // res.writeHead(200, { 'Content-Type': 'application/json' });
461
- // res.end(
462
- // JSON.stringify({
463
- // status: 'success',
464
- // data: result,
465
- // }),
466
- // );
467
- // } catch (error) {
468
- // this.logger.error(
469
- // 'Error executing Prometheus range query:',
470
- // error,
471
- // );
472
- // res.writeHead(400, { 'Content-Type': 'application/json' });
473
- // res.end(
474
- // JSON.stringify({
475
- // status: 'error',
476
- // errorType: 'bad_data',
477
- // error: error.message,
478
- // }),
479
- // );
480
- // }
481
- // return;
482
- // }
483
- // // Default metrics endpoint
484
- // if (pathname === '/metrics') {
485
- // const metrics = await sharedRegistry.metrics();
486
- // res.writeHead(200, { 'Content-Type': 'text/plain' });
487
- // res.end(metrics);
488
- // return;
489
- // }
490
- // // Health check endpoint
491
- // if (pathname === '/health') {
492
- // res.writeHead(200, { 'Content-Type': 'application/json' });
493
- // res.end(JSON.stringify({ status: 'ok' }));
494
- // return;
495
- // }
496
- // // Prometheus label values endpoint (for metric discovery)
497
- // if (pathname === '/api/v1/label/__name__/values') {
498
- // try {
499
- // const metrics = await sharedRegistry.getMetricsAsJSON();
500
- // const metricNames = metrics.map((m) => m.name);
501
- // res.writeHead(200, { 'Content-Type': 'application/json' });
502
- // res.end(
503
- // JSON.stringify({
504
- // status: 'success',
505
- // data: metricNames,
506
- // }),
507
- // );
508
- // } catch (error) {
509
- // this.logger.error('Error getting metric names:', error);
510
- // res.writeHead(500, { 'Content-Type': 'application/json' });
511
- // res.end(
512
- // JSON.stringify({
513
- // status: 'error',
514
- // error: error.message,
515
- // }),
516
- // );
517
- // }
518
- // return;
519
- // }
520
- // // Default response for unknown endpoints
521
- // res.writeHead(404, { 'Content-Type': 'application/json' });
522
- // res.end(JSON.stringify({ error: 'Not found' }));
523
- // } catch (error) {
524
- // this.logger.error('Error handling metrics request:', error);
525
- // res.writeHead(500, { 'Content-Type': 'application/json' });
526
- // res.end(JSON.stringify({ error: 'Internal server error' }));
527
- // }
528
- // });
529
- // server.listen(3001, '127.0.0.1');
530
- // this.logger.debug('Metrics server started on port', server.address());
531
- // }
532
- // } catch (err) {
533
- // this.logger.error('Error starting metrics server: ', err);
534
- // }
535
- // }
536
284
  }
537
285
  listenForNetworkEvents() {
538
286
  this.networkActivity = new NetworkActivity(this.logger, this.p2pNode);
@@ -2,8 +2,6 @@ import { oAddress, oCoreNode } from '../../core/index.js';
2
2
  import { oPlanContext } from '../plan.context.js';
3
3
  export interface oPlanConfig {
4
4
  intent: string;
5
- noIndex?: boolean;
6
- useCache?: boolean;
7
5
  context?: oPlanContext;
8
6
  sequence?: any[];
9
7
  currentNode: oCoreNode;
@@ -1 +1 @@
1
- {"version":3,"file":"plan-config.interface.d.ts","sourceRoot":"","sources":["../../../src/plan/interfaces/plan-config.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,WAAW,WAAW;IAE1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;IAGjB,WAAW,EAAE,SAAS,CAAC;IACvB,MAAM,EAAE,QAAQ,CAAC;IACjB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,cAAc,CAAC,EAAE,CACf,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,KACjB,MAAM,CAAC;CACb"}
1
+ {"version":3,"file":"plan-config.interface.d.ts","sourceRoot":"","sources":["../../../src/plan/interfaces/plan-config.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,WAAW,WAAW;IAE1B,MAAM,EAAE,MAAM,CAAC;IAEf,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;IAGjB,WAAW,EAAE,SAAS,CAAC;IACvB,MAAM,EAAE,QAAQ,CAAC;IACjB,QAA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-75,8 +75,6 @@ export class oPlan {
75
75
  params: {
76
76
  key: cid.toString(),
77
77
  },
78
- }, {
79
- noIndex: true,
80
78
  });
81
79
  this.logger.debug('Search plans response: ', response);
82
80
  const result = response.result;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olane/o-core",
3
- "version": "0.1.6",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -32,12 +32,6 @@
32
32
  "license": "ISC",
33
33
  "description": "Olane addressable p2p node used to host tools, data or anything else your heart can dream of.",
34
34
  "devDependencies": {
35
- "@babel/core": "^7.27.4",
36
- "@babel/plugin-proposal-class-properties": "^7.18.6",
37
- "@babel/plugin-proposal-decorators": "^7.23.9",
38
- "@babel/preset-env": "^7.27.2",
39
- "@babel/preset-react": "^7.27.1",
40
- "@babel/preset-typescript": "^7.27.1",
41
35
  "@eslint/eslintrc": "^3.3.1",
42
36
  "@eslint/js": "^9.29.0",
43
37
  "@olane/o-config": "file:./packages/o-config",
@@ -47,33 +41,26 @@
47
41
  "@types/uuid": "^10.0.0",
48
42
  "@typescript-eslint/eslint-plugin": "^8.34.1",
49
43
  "@typescript-eslint/parser": "^8.34.1",
50
- "babel-loader": "^10.0.0",
51
44
  "eslint": "^9.29.0",
52
45
  "eslint-config-prettier": "^10.1.6",
53
46
  "eslint-plugin-prettier": "^5.5.0",
54
47
  "globals": "^16.2.0",
55
48
  "jest": "^30.0.0",
56
- "nodemon": "^3.1.10",
57
49
  "prettier": "^3.5.3",
58
50
  "ts-jest": "^29.4.0",
59
- "ts-loader": "^9.5.2",
60
51
  "ts-node": "^10.9.2",
61
52
  "tsconfig-paths": "^4.2.0",
62
53
  "tsx": "^4.20.3",
63
- "typescript": "^5.8.3",
64
- "webpack": "^5.99.9",
65
- "webpack-cli": "^6.0.1",
66
- "webpack-dev-server": "^5.2.2"
54
+ "typescript": "^5.8.3"
67
55
  },
68
56
  "peerDependencies": {
69
- "@olane/o-config": "^0.1.6",
70
- "@olane/o-protocol": "^0.1.6"
57
+ "@olane/o-config": "^0.2.0",
58
+ "@olane/o-protocol": "^0.2.0"
71
59
  },
72
60
  "dependencies": {
73
61
  "chalk": "^5.4.1",
74
62
  "debug": "^4.4.1",
75
63
  "dotenv": "^16.5.0",
76
- "multiformats": "^13.3.7",
77
- "prom-client": "^15.1.3"
64
+ "multiformats": "^13.3.7"
78
65
  }
79
66
  }
@@ -1,6 +0,0 @@
1
- export interface UseOptions {
2
- intent?: string;
3
- noIndex?: boolean;
4
- useCache?: boolean;
5
- }
6
- //# sourceMappingURL=use-options.interface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-options.interface.d.ts","sourceRoot":"","sources":["../../../src/core/interfaces/use-options.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
@@ -1 +0,0 @@
1
- export {};