@olane/o-node 0.7.12-alpha.39 → 0.7.12-alpha.40
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.
- package/dist/o-core/src/connection/index.d.ts +8 -0
- package/dist/o-core/src/connection/index.d.ts.map +1 -0
- package/dist/o-core/src/connection/index.js +7 -0
- package/dist/o-core/src/connection/interfaces/connection-manager.config.d.ts +15 -0
- package/dist/o-core/src/connection/interfaces/connection-manager.config.d.ts.map +1 -0
- package/dist/o-core/src/connection/interfaces/connection-manager.config.js +1 -0
- package/dist/o-core/src/connection/interfaces/connection-send-params.interface.d.ts +9 -0
- package/dist/o-core/src/connection/interfaces/connection-send-params.interface.d.ts.map +1 -0
- package/dist/o-core/src/connection/interfaces/connection-send-params.interface.js +1 -0
- package/dist/o-core/src/connection/interfaces/connection.config.d.ts +20 -0
- package/dist/o-core/src/connection/interfaces/connection.config.d.ts.map +1 -0
- package/dist/o-core/src/connection/interfaces/connection.config.js +1 -0
- package/dist/o-core/src/connection/interfaces/index.d.ts +5 -0
- package/dist/o-core/src/connection/interfaces/index.d.ts.map +1 -0
- package/dist/o-core/src/connection/interfaces/index.js +4 -0
- package/dist/o-core/src/connection/interfaces/request-state.enum.d.ts +7 -0
- package/dist/o-core/src/connection/interfaces/request-state.enum.d.ts.map +1 -0
- package/dist/o-core/src/connection/interfaces/request-state.enum.js +7 -0
- package/dist/o-core/src/connection/o-connection-manager.d.ts +19 -0
- package/dist/o-core/src/connection/o-connection-manager.d.ts.map +1 -0
- package/dist/o-core/src/connection/o-connection-manager.js +27 -0
- package/dist/o-core/src/connection/o-connection.d.ts +26 -0
- package/dist/o-core/src/connection/o-connection.d.ts.map +1 -0
- package/dist/o-core/src/connection/o-connection.js +54 -0
- package/dist/o-core/src/connection/o-request.d.ts +23 -0
- package/dist/o-core/src/connection/o-request.d.ts.map +1 -0
- package/dist/o-core/src/connection/o-request.js +42 -0
- package/dist/o-core/src/connection/o-response.d.ts +1 -0
- package/dist/o-core/src/connection/o-response.d.ts.map +1 -1
- package/dist/o-core/src/connection/o-response.js +7 -0
- package/dist/o-core/src/core/defaults/config.d.ts +4 -0
- package/dist/o-core/src/core/defaults/config.d.ts.map +1 -0
- package/dist/o-core/src/core/defaults/config.js +5 -0
- package/dist/o-core/src/core/defaults/index.d.ts +2 -0
- package/dist/o-core/src/core/defaults/index.d.ts.map +1 -0
- package/dist/o-core/src/core/defaults/index.js +1 -0
- package/dist/o-core/src/core/graceful-shutdown.d.ts +25 -0
- package/dist/o-core/src/core/graceful-shutdown.d.ts.map +1 -0
- package/dist/o-core/src/core/graceful-shutdown.js +84 -0
- package/dist/o-core/src/core/index.d.ts +9 -0
- package/dist/o-core/src/core/index.d.ts.map +1 -0
- package/dist/o-core/src/core/index.js +8 -0
- package/dist/o-core/src/core/interfaces/index.d.ts +7 -0
- package/dist/o-core/src/core/interfaces/index.d.ts.map +1 -0
- package/dist/o-core/src/core/interfaces/index.js +6 -0
- package/dist/o-core/src/core/interfaces/node-type.enum.d.ts +10 -0
- package/dist/o-core/src/core/interfaces/node-type.enum.d.ts.map +1 -0
- package/dist/o-core/src/core/interfaces/node-type.enum.js +10 -0
- package/dist/o-core/src/core/interfaces/o-core.config.d.ts +23 -0
- package/dist/o-core/src/core/interfaces/o-core.config.d.ts.map +1 -0
- package/dist/o-core/src/core/interfaces/o-core.config.js +1 -0
- package/dist/o-core/src/core/interfaces/o-core.interface.d.ts +18 -0
- package/dist/o-core/src/core/interfaces/o-core.interface.d.ts.map +1 -0
- package/dist/o-core/src/core/interfaces/o-core.interface.js +1 -0
- package/dist/o-core/src/core/interfaces/state.enum.d.ts +8 -0
- package/dist/o-core/src/core/interfaces/state.enum.d.ts.map +1 -0
- package/dist/o-core/src/core/interfaces/state.enum.js +8 -0
- package/dist/o-core/src/core/interfaces/use-options.interface.d.ts +11 -0
- package/dist/o-core/src/core/interfaces/use-options.interface.d.ts.map +1 -0
- package/dist/o-core/src/core/interfaces/use-options.interface.js +1 -0
- package/dist/o-core/src/core/interfaces/use-stream-options.interface.d.ts +4 -0
- package/dist/o-core/src/core/interfaces/use-stream-options.interface.d.ts.map +1 -0
- package/dist/o-core/src/core/interfaces/use-stream-options.interface.js +1 -0
- package/dist/o-core/src/core/lib/events/connection-events.d.ts +31 -0
- package/dist/o-core/src/core/lib/events/connection-events.d.ts.map +1 -0
- package/dist/o-core/src/core/lib/events/connection-events.js +46 -0
- package/dist/o-core/src/core/lib/events/hierarchy-events.d.ts +69 -0
- package/dist/o-core/src/core/lib/events/hierarchy-events.d.ts.map +1 -0
- package/dist/o-core/src/core/lib/events/hierarchy-events.js +100 -0
- package/dist/o-core/src/core/lib/events/index.d.ts +6 -0
- package/dist/o-core/src/core/lib/events/index.d.ts.map +1 -0
- package/dist/o-core/src/core/lib/events/index.js +5 -0
- package/dist/o-core/src/core/lib/events/node-events.d.ts +40 -0
- package/dist/o-core/src/core/lib/events/node-events.d.ts.map +1 -0
- package/dist/o-core/src/core/lib/events/node-events.js +58 -0
- package/dist/o-core/src/core/lib/events/o-notification-event.d.ts +26 -0
- package/dist/o-core/src/core/lib/events/o-notification-event.d.ts.map +1 -0
- package/dist/o-core/src/core/lib/events/o-notification-event.js +30 -0
- package/dist/o-core/src/core/lib/index.d.ts +8 -0
- package/dist/o-core/src/core/lib/index.d.ts.map +1 -0
- package/dist/o-core/src/core/lib/index.js +7 -0
- package/dist/o-core/src/core/lib/interfaces/notification-types.d.ts +49 -0
- package/dist/o-core/src/core/lib/interfaces/notification-types.d.ts.map +1 -0
- package/dist/o-core/src/core/lib/interfaces/notification-types.js +1 -0
- package/dist/o-core/src/core/lib/o-hierarchy.manager.d.ts +24 -0
- package/dist/o-core/src/core/lib/o-hierarchy.manager.d.ts.map +1 -0
- package/dist/o-core/src/core/lib/o-hierarchy.manager.js +58 -0
- package/dist/o-core/src/core/lib/o-metrics.d.ts +5 -0
- package/dist/o-core/src/core/lib/o-metrics.d.ts.map +1 -0
- package/dist/o-core/src/core/lib/o-metrics.js +6 -0
- package/dist/o-core/src/core/lib/o-notification.manager.d.ts +58 -0
- package/dist/o-core/src/core/lib/o-notification.manager.d.ts.map +1 -0
- package/dist/o-core/src/core/lib/o-notification.manager.js +159 -0
- package/dist/o-core/src/core/lib/o-request.manager.d.ts +10 -0
- package/dist/o-core/src/core/lib/o-request.manager.d.ts.map +1 -0
- package/dist/o-core/src/core/lib/o-request.manager.js +18 -0
- package/dist/o-core/src/core/lib/utils/event-filters.d.ts +38 -0
- package/dist/o-core/src/core/lib/utils/event-filters.d.ts.map +1 -0
- package/dist/o-core/src/core/lib/utils/event-filters.js +159 -0
- package/dist/o-core/src/core/o-core.d.ts +240 -0
- package/dist/o-core/src/core/o-core.d.ts.map +1 -0
- package/dist/o-core/src/core/o-core.js +463 -0
- package/dist/o-core/src/core/o-dependency.d.ts +9 -0
- package/dist/o-core/src/core/o-dependency.d.ts.map +1 -0
- package/dist/o-core/src/core/o-dependency.js +15 -0
- package/dist/o-core/src/core/o-object.d.ts +7 -0
- package/dist/o-core/src/core/o-object.d.ts.map +1 -0
- package/dist/o-core/src/core/o-object.js +10 -0
- package/dist/o-core/src/core/o-parameter.d.ts +12 -0
- package/dist/o-core/src/core/o-parameter.d.ts.map +1 -0
- package/dist/o-core/src/core/o-parameter.js +21 -0
- package/dist/o-core/src/error/index.d.ts +3 -0
- package/dist/o-core/src/error/index.d.ts.map +1 -0
- package/dist/o-core/src/error/index.js +2 -0
- package/dist/o-core/src/index.d.ts +8 -0
- package/dist/o-core/src/index.d.ts.map +1 -0
- package/dist/o-core/src/index.js +7 -0
- package/dist/o-core/src/response/index.d.ts +2 -0
- package/dist/o-core/src/response/index.d.ts.map +1 -0
- package/dist/o-core/src/response/index.js +1 -0
- package/dist/o-core/src/response/response-builder.d.ts +140 -0
- package/dist/o-core/src/response/response-builder.d.ts.map +1 -0
- package/dist/o-core/src/response/response-builder.js +190 -0
- package/dist/o-core/src/router/enums/restricted-addresses.enum.d.ts +8 -0
- package/dist/o-core/src/router/enums/restricted-addresses.enum.d.ts.map +1 -0
- package/dist/o-core/src/router/enums/restricted-addresses.enum.js +13 -0
- package/dist/o-core/src/router/index.d.ts +11 -0
- package/dist/o-core/src/router/index.d.ts.map +1 -0
- package/dist/o-core/src/router/index.js +10 -0
- package/dist/o-core/src/router/interfaces/resolve.request.d.ts +10 -0
- package/dist/o-core/src/router/interfaces/resolve.request.d.ts.map +1 -0
- package/dist/o-core/src/router/interfaces/resolve.request.js +1 -0
- package/dist/o-core/src/router/interfaces/route.response.d.ts +8 -0
- package/dist/o-core/src/router/interfaces/route.response.d.ts.map +1 -0
- package/dist/o-core/src/router/interfaces/route.response.js +1 -0
- package/dist/o-core/src/router/o-address-resolver.d.ts +14 -0
- package/dist/o-core/src/router/o-address-resolver.d.ts.map +1 -0
- package/dist/o-core/src/router/o-address-resolver.js +19 -0
- package/dist/o-core/src/router/o-address.d.ts +33 -0
- package/dist/o-core/src/router/o-address.d.ts.map +1 -0
- package/dist/o-core/src/router/o-address.js +114 -0
- package/dist/o-core/src/router/o-request-preparation.d.ts +37 -0
- package/dist/o-core/src/router/o-request-preparation.d.ts.map +1 -0
- package/dist/o-core/src/router/o-request-preparation.js +75 -0
- package/dist/o-core/src/router/o-request.router.d.ts +18 -0
- package/dist/o-core/src/router/o-request.router.d.ts.map +1 -0
- package/dist/o-core/src/router/o-request.router.js +12 -0
- package/dist/o-core/src/router/o-resolver-chain.d.ts +32 -0
- package/dist/o-core/src/router/o-resolver-chain.d.ts.map +1 -0
- package/dist/o-core/src/router/o-resolver-chain.js +62 -0
- package/dist/o-core/src/router/o-router.d.ts +19 -0
- package/dist/o-core/src/router/o-router.d.ts.map +1 -0
- package/dist/o-core/src/router/o-router.js +14 -0
- package/dist/o-core/src/router/o-routing-policy.d.ts +36 -0
- package/dist/o-core/src/router/o-routing-policy.d.ts.map +1 -0
- package/dist/o-core/src/router/o-routing-policy.js +19 -0
- package/dist/o-core/src/transports/custom.transport.d.ts +6 -0
- package/dist/o-core/src/transports/custom.transport.d.ts.map +1 -0
- package/dist/o-core/src/transports/custom.transport.js +10 -0
- package/dist/o-core/src/transports/index.d.ts +4 -0
- package/dist/o-core/src/transports/index.d.ts.map +1 -0
- package/dist/o-core/src/transports/index.js +3 -0
- package/dist/o-core/src/transports/interfaces/transport-type.enum.d.ts +5 -0
- package/dist/o-core/src/transports/interfaces/transport-type.enum.d.ts.map +1 -0
- package/dist/o-core/src/transports/interfaces/transport-type.enum.js +5 -0
- package/dist/o-core/src/transports/o-transport.d.ts +10 -0
- package/dist/o-core/src/transports/o-transport.d.ts.map +1 -0
- package/dist/o-core/src/transports/o-transport.js +16 -0
- package/dist/o-core/src/utils/core.utils.d.ts +34 -0
- package/dist/o-core/src/utils/core.utils.d.ts.map +1 -0
- package/dist/o-core/src/utils/core.utils.js +123 -0
- package/dist/o-core/src/utils/index.d.ts +6 -0
- package/dist/o-core/src/utils/index.d.ts.map +1 -0
- package/dist/o-core/src/utils/index.js +5 -0
- package/dist/o-core/src/utils/logger.d.ts +14 -0
- package/dist/o-core/src/utils/logger.d.ts.map +1 -0
- package/dist/o-core/src/utils/logger.js +31 -0
- package/dist/o-core/src/utils/object.utils.d.ts +5 -0
- package/dist/o-core/src/utils/object.utils.d.ts.map +1 -0
- package/dist/o-core/src/utils/object.utils.js +23 -0
- package/dist/o-core/src/utils/regex.utils.d.ts +4 -0
- package/dist/o-core/src/utils/regex.utils.d.ts.map +1 -0
- package/dist/o-core/src/utils/regex.utils.js +13 -0
- package/dist/o-core/src/utils/remote.utils.d.ts +4 -0
- package/dist/o-core/src/utils/remote.utils.d.ts.map +1 -0
- package/dist/o-core/src/utils/remote.utils.js +5 -0
- package/dist/o-node/src/connection/o-node-connection.d.ts +2 -2
- package/dist/o-node/src/connection/o-node-connection.d.ts.map +1 -1
- package/dist/o-node/src/connection/o-node-connection.js +36 -23
- package/dist/o-node/src/connection/o-node-connection.manager.d.ts.map +1 -1
- package/dist/o-node/src/connection/o-node-connection.manager.js +13 -41
- package/dist/o-node/src/index.d.ts +1 -0
- package/dist/o-node/src/index.d.ts.map +1 -1
- package/dist/o-node/src/index.js +1 -0
- package/dist/o-node/src/interfaces/o-node.config.d.ts +0 -17
- package/dist/o-node/src/interfaces/o-node.config.d.ts.map +1 -1
- package/dist/o-node/src/managers/o-connection-heartbeat.manager.d.ts +1 -0
- package/dist/o-node/src/managers/o-connection-heartbeat.manager.d.ts.map +1 -1
- package/dist/o-node/src/managers/o-connection-heartbeat.manager.js +17 -3
- package/dist/o-node/src/o-node.d.ts +11 -12
- package/dist/o-node/src/o-node.d.ts.map +1 -1
- package/dist/o-node/src/o-node.js +104 -25
- package/dist/o-node/src/o-node.notification-manager.js +4 -1
- package/dist/o-node/src/o-node.tool.d.ts.map +1 -1
- package/dist/o-node/src/o-node.tool.js +16 -23
- package/dist/o-node/src/router/o-node.router.d.ts +1 -0
- package/dist/o-node/src/router/o-node.router.d.ts.map +1 -1
- package/dist/o-node/src/router/o-node.router.js +53 -7
- package/dist/o-node/src/router/resolvers/o-node.resolver.d.ts.map +1 -1
- package/dist/o-node/src/router/resolvers/o-node.resolver.js +5 -1
- package/dist/o-node/src/ui/index.d.ts +3 -0
- package/dist/o-node/src/ui/index.d.ts.map +1 -0
- package/dist/o-node/src/ui/index.js +2 -0
- package/dist/o-node/src/ui/types.d.ts +110 -0
- package/dist/o-node/src/ui/types.d.ts.map +1 -0
- package/dist/o-node/src/ui/types.js +17 -0
- package/dist/o-node/src/ui/ui-graph.manager.d.ts +70 -0
- package/dist/o-node/src/ui/ui-graph.manager.d.ts.map +1 -0
- package/dist/o-node/src/ui/ui-graph.manager.js +274 -0
- package/dist/o-node/src/utils/index.d.ts +0 -2
- package/dist/o-node/src/utils/index.d.ts.map +1 -1
- package/dist/o-node/src/utils/index.js +0 -2
- package/dist/o-node/src/utils/stream.utils.d.ts.map +1 -1
- package/dist/o-node/src/utils/stream.utils.js +25 -21
- package/dist/o-node/test/helpers/test-node.tool.d.ts +15 -0
- package/dist/o-node/test/helpers/test-node.tool.d.ts.map +1 -0
- package/dist/o-node/test/helpers/test-node.tool.js +27 -0
- package/dist/src/connection/o-node-connection.manager.d.ts +14 -4
- package/dist/src/connection/o-node-connection.manager.d.ts.map +1 -1
- package/dist/src/connection/o-node-connection.manager.js +61 -29
- package/package.json +6 -6
|
@@ -17,7 +17,10 @@ export class oNodeNotificationManager extends oNotificationManager {
|
|
|
17
17
|
this.logger.debug('Setting up libp2p event listeners...');
|
|
18
18
|
// Peer connection events
|
|
19
19
|
this.p2pNode.addEventListener('peer:connect', this.handlePeerConnect.bind(this));
|
|
20
|
-
this.p2pNode.addEventListener(
|
|
20
|
+
// this.p2pNode.addEventListener(
|
|
21
|
+
// 'peer:disconnect',
|
|
22
|
+
// this.handlePeerDisconnect.bind(this),
|
|
23
|
+
// );
|
|
21
24
|
// Peer discovery events
|
|
22
25
|
this.p2pNode.addEventListener('peer:discovery', this.handlePeerDiscovery.bind(this));
|
|
23
26
|
// Connection events
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"o-node.tool.d.ts","sourceRoot":"","sources":["../../../src/o-node.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAGR,QAAQ,
|
|
1
|
+
{"version":3,"file":"o-node.tool.d.ts","sourceRoot":"","sources":["../../../src/o-node.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAGR,QAAQ,EAIT,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;;AAIrD;;;;GAIG;AACH,qBAAa,SAAU,SAAQ,cAAkB;IACzC,cAAc,CAAC,OAAO,EAAE,QAAQ;IAUhC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAW3B,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAuCnE,cAAc,IAAI,OAAO,CAAC,GAAG,CAAC;IAQ9B,oBAAoB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;CA2B5D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CoreUtils,
|
|
1
|
+
import { CoreUtils, oRequest, ResponseBuilder, ChildJoinedEvent, } from '@olane/o-core';
|
|
2
2
|
import { oTool } from '@olane/o-tool';
|
|
3
3
|
import { oServerNode } from './nodes/server.node.js';
|
|
4
4
|
import { oNodeTransport } from './router/o-node.transport.js';
|
|
@@ -12,8 +12,10 @@ export class oNodeTool extends oTool(oServerNode) {
|
|
|
12
12
|
async handleProtocol(address) {
|
|
13
13
|
this.logger.debug('Handling protocol: ' + address.protocol);
|
|
14
14
|
await this.p2pNode.handle(address.protocol, this.handleStream.bind(this), {
|
|
15
|
-
maxInboundStreams:
|
|
16
|
-
maxOutboundStreams:
|
|
15
|
+
maxInboundStreams: 10000,
|
|
16
|
+
maxOutboundStreams: process.env.MAX_OUTBOUND_STREAMS
|
|
17
|
+
? parseInt(process.env.MAX_OUTBOUND_STREAMS)
|
|
18
|
+
: 1000,
|
|
17
19
|
});
|
|
18
20
|
}
|
|
19
21
|
async initialize() {
|
|
@@ -33,29 +35,20 @@ export class oNodeTool extends oTool(oServerNode) {
|
|
|
33
35
|
this.logger.warn('Malformed event data');
|
|
34
36
|
return;
|
|
35
37
|
}
|
|
36
|
-
const requestConfig = await CoreUtils.
|
|
38
|
+
const requestConfig = await CoreUtils.processStream(event);
|
|
37
39
|
const request = new oRequest(requestConfig);
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
: new oError(oErrorCodes.UNKNOWN, error.message);
|
|
45
|
-
return {
|
|
46
|
-
error: responseError.toJSON(),
|
|
47
|
-
};
|
|
48
|
-
});
|
|
49
|
-
// Non-streaming response - original behavior
|
|
50
|
-
if (success) {
|
|
51
|
-
this.metrics.successCount++;
|
|
40
|
+
// Use ResponseBuilder with automatic error handling and metrics tracking
|
|
41
|
+
const responseBuilder = ResponseBuilder.create().withMetrics(this.metrics);
|
|
42
|
+
let response;
|
|
43
|
+
try {
|
|
44
|
+
const result = await this.execute(request, stream);
|
|
45
|
+
response = await responseBuilder.build(request, result, null);
|
|
52
46
|
}
|
|
53
|
-
|
|
54
|
-
this.
|
|
47
|
+
catch (error) {
|
|
48
|
+
this.logger.error('Error executing tool: ', request.toString(), error, typeof error);
|
|
49
|
+
response = await responseBuilder.buildError(request, error);
|
|
55
50
|
}
|
|
56
|
-
//
|
|
57
|
-
const response = CoreUtils.buildResponse(request, result, result?.error);
|
|
58
|
-
// add the request method to the response
|
|
51
|
+
// Send the response
|
|
59
52
|
await CoreUtils.sendResponse(response, stream);
|
|
60
53
|
};
|
|
61
54
|
// Attach listener synchronously before any async operations
|
|
@@ -17,6 +17,7 @@ export declare class oNodeRouter extends oToolRouter {
|
|
|
17
17
|
protected forward(address: oNodeAddress, request: oRouterRequest, node: oNode): Promise<any>;
|
|
18
18
|
/**
|
|
19
19
|
* Executes a request locally when routing to self.
|
|
20
|
+
* Now uses ResponseBuilder for consistency with useSelf() behavior.
|
|
20
21
|
*/
|
|
21
22
|
private executeSelfRouting;
|
|
22
23
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"o-node.router.d.ts","sourceRoot":"","sources":["../../../../src/router/o-node.router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAML,cAAc,
|
|
1
|
+
{"version":3,"file":"o-node.router.d.ts","sourceRoot":"","sources":["../../../../src/router/o-node.router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAML,cAAc,EAGd,aAAa,EACd,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAO5C,qBAAa,WAAY,SAAQ,WAAW;IAC1C,OAAO,CAAC,aAAa,CAAqB;;IAO1C;;;;;;;;OAQG;cACa,OAAO,CACrB,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,KAAK,GACV,OAAO,CAAC,GAAG,CAAC;IA6Bf;;;OAGG;YACW,kBAAkB;IA8DhC;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAS5B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAWhC;;OAEG;YACW,eAAe;IA2C7B;;;OAGG;IACG,SAAS,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,aAAa,CAAC;IAyB3E;;;OAGG;IACH,UAAU,CAAC,qBAAqB,EAAE,YAAY,EAAE,IAAI,EAAE,KAAK,GAAG,OAAO;CAGtE"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { CoreUtils, oAddress, oError, oErrorCodes, oRequest, } from '@olane/o-core';
|
|
1
|
+
import { CoreUtils, oAddress, oError, oErrorCodes, oRequest, ResponseBuilder, } from '@olane/o-core';
|
|
2
2
|
import { oToolRouter } from '@olane/o-tool';
|
|
3
3
|
import { oNodeConnection } from '../connection/o-node-connection.js';
|
|
4
4
|
import { oNodeRoutingPolicy } from './o-node.routing-policy.js';
|
|
5
|
+
import { oStreamRequest } from '../connection/o-stream.request.js';
|
|
5
6
|
export class oNodeRouter extends oToolRouter {
|
|
6
7
|
constructor() {
|
|
7
8
|
super();
|
|
@@ -25,6 +26,9 @@ export class oNodeRouter extends oToolRouter {
|
|
|
25
26
|
params: request.params,
|
|
26
27
|
id: request.id,
|
|
27
28
|
});
|
|
29
|
+
if (request.stream) {
|
|
30
|
+
nextHopRequest.stream = request.stream;
|
|
31
|
+
}
|
|
28
32
|
// Handle self-routing: execute locally instead of dialing
|
|
29
33
|
if (this.routingPolicy.isSelfAddress(address, node)) {
|
|
30
34
|
return this.executeSelfRouting(request, node);
|
|
@@ -39,17 +43,55 @@ export class oNodeRouter extends oToolRouter {
|
|
|
39
43
|
}
|
|
40
44
|
/**
|
|
41
45
|
* Executes a request locally when routing to self.
|
|
46
|
+
* Now uses ResponseBuilder for consistency with useSelf() behavior.
|
|
42
47
|
*/
|
|
43
48
|
async executeSelfRouting(request, node) {
|
|
44
49
|
const { payload } = request.params;
|
|
45
50
|
const params = payload.params;
|
|
46
51
|
const localRequest = new oRequest({
|
|
47
52
|
method: payload.method,
|
|
48
|
-
params: {
|
|
53
|
+
params: {
|
|
54
|
+
...params,
|
|
55
|
+
_connectionId: request.params._connectionId,
|
|
56
|
+
_requestMethod: payload.method,
|
|
57
|
+
},
|
|
49
58
|
id: request.id,
|
|
50
59
|
});
|
|
51
|
-
|
|
52
|
-
|
|
60
|
+
// Create ResponseBuilder with metrics tracking
|
|
61
|
+
const responseBuilder = ResponseBuilder.create().withMetrics(node.metrics);
|
|
62
|
+
// Handle streaming requests
|
|
63
|
+
const isStream = request.params._isStreaming;
|
|
64
|
+
if (isStream && request.stream) {
|
|
65
|
+
// For streaming, we need to handle the stream chunks
|
|
66
|
+
try {
|
|
67
|
+
const result = await node.execute(localRequest, request.stream);
|
|
68
|
+
const response = await responseBuilder.build(localRequest, result, null, {
|
|
69
|
+
isStream: true,
|
|
70
|
+
});
|
|
71
|
+
// Return unwrapped data for consistency with dialAndTransmit
|
|
72
|
+
return response.result.data;
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
const errorResponse = await responseBuilder.buildError(localRequest, error, {
|
|
76
|
+
isStream: true,
|
|
77
|
+
});
|
|
78
|
+
// For errors, throw to match remote behavior
|
|
79
|
+
throw responseBuilder.normalizeError(error);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
// Handle non-streaming requests with error handling
|
|
83
|
+
try {
|
|
84
|
+
const result = await node.execute(localRequest);
|
|
85
|
+
const response = await responseBuilder.build(localRequest, result, null);
|
|
86
|
+
// Return unwrapped data to match dialAndTransmit behavior
|
|
87
|
+
return response.result.data;
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
// Build error response for metrics tracking
|
|
91
|
+
await responseBuilder.buildError(localRequest, error);
|
|
92
|
+
// Then throw the normalized error
|
|
93
|
+
throw responseBuilder.normalizeError(error);
|
|
94
|
+
}
|
|
53
95
|
}
|
|
54
96
|
/**
|
|
55
97
|
* Checks if the next hop is the final destination address.
|
|
@@ -65,10 +107,11 @@ export class oNodeRouter extends oToolRouter {
|
|
|
65
107
|
unwrapDestinationRequest(request) {
|
|
66
108
|
const { payload } = request.params;
|
|
67
109
|
const params = payload.params;
|
|
68
|
-
return new
|
|
110
|
+
return new oStreamRequest({
|
|
69
111
|
method: payload.method,
|
|
70
112
|
params: { ...params },
|
|
71
113
|
id: request.id,
|
|
114
|
+
stream: request.stream,
|
|
72
115
|
});
|
|
73
116
|
}
|
|
74
117
|
/**
|
|
@@ -76,19 +119,22 @@ export class oNodeRouter extends oToolRouter {
|
|
|
76
119
|
*/
|
|
77
120
|
async dialAndTransmit(address, request, node) {
|
|
78
121
|
try {
|
|
122
|
+
const isStream = request.params._isStreaming ||
|
|
123
|
+
request.params.payload?.params?._isStreaming;
|
|
79
124
|
const connection = await node.p2pNode.dial(address.libp2pTransports.map((t) => t.toMultiaddr()));
|
|
80
125
|
const nodeConnection = new oNodeConnection({
|
|
81
126
|
p2pConnection: connection,
|
|
82
127
|
nextHopAddress: address,
|
|
83
128
|
address: node.address,
|
|
84
129
|
callerAddress: node.address,
|
|
130
|
+
isStream: isStream,
|
|
85
131
|
});
|
|
86
|
-
if (
|
|
132
|
+
if (isStream) {
|
|
87
133
|
const routeRequest = request;
|
|
88
134
|
if (!routeRequest.stream) {
|
|
89
135
|
throw new oError(oErrorCodes.INVALID_REQUEST, 'Stream is required');
|
|
90
136
|
}
|
|
91
|
-
nodeConnection.onChunk((response) => {
|
|
137
|
+
nodeConnection.onChunk(async (response) => {
|
|
92
138
|
CoreUtils.sendStreamResponse(response, routeRequest.stream);
|
|
93
139
|
});
|
|
94
140
|
// allow this to continue as we will tell the transmitter to stream the response and we will intercept via the above listener
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"o-node.resolver.d.ts","sourceRoot":"","sources":["../../../../../src/router/resolvers/o-node.resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAEhB,aAAa,
|
|
1
|
+
{"version":3,"file":"o-node.resolver.d.ts","sourceRoot":"","sources":["../../../../../src/router/resolvers/o-node.resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAEhB,aAAa,EAId,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,qBAAa,aAAc,SAAQ,gBAAgB;IACrC,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,YAAY;gBAArB,OAAO,EAAE,YAAY;IAIpD,IAAI,mBAAmB,IAAI,aAAa,EAAE,CAEzC;IAEK,OAAO,CAAC,YAAY,EAAE,cAAc,GAAG,OAAO,CAAC,mBAAmB,CAAC;CA8C1E"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { oAddressResolver, TransportType, } from '@olane/o-core';
|
|
1
|
+
import { oAddressResolver, oAddress, TransportType, oError, oErrorCodes, } from '@olane/o-core';
|
|
2
2
|
import { oNodeAddress } from '../o-node.address.js';
|
|
3
3
|
export class oNodeResolver extends oAddressResolver {
|
|
4
4
|
constructor(address) {
|
|
@@ -32,6 +32,10 @@ export class oNodeResolver extends oAddressResolver {
|
|
|
32
32
|
requestOverride: request,
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
+
// no child address, and we have already been to the leader, fail
|
|
36
|
+
if (address.toString().indexOf(oAddress.leader().toString()) > -1) {
|
|
37
|
+
throw new oError(oErrorCodes.NOT_FOUND, targetAddress.toString() + ' node not found.');
|
|
38
|
+
}
|
|
35
39
|
return {
|
|
36
40
|
nextHopAddress: address,
|
|
37
41
|
targetAddress: targetAddress,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { oAddress } from '../../../o-core/src';
|
|
2
|
+
/**
|
|
3
|
+
* UI component node types
|
|
4
|
+
*/
|
|
5
|
+
export declare enum UINodeType {
|
|
6
|
+
SCREEN = "screen",
|
|
7
|
+
BUTTON = "button",
|
|
8
|
+
INPUT = "input",
|
|
9
|
+
TEXT = "text",
|
|
10
|
+
VIEW = "view",
|
|
11
|
+
MODAL = "modal",
|
|
12
|
+
BOTTOM_SHEET = "bottom_sheet",
|
|
13
|
+
FORM = "form",
|
|
14
|
+
LIST = "list",
|
|
15
|
+
LIST_ITEM = "list_item",
|
|
16
|
+
CUSTOM = "custom"
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Represents a virtual UI component node in the graph
|
|
20
|
+
*/
|
|
21
|
+
export interface ComponentNode {
|
|
22
|
+
/** Unique identifier for the component */
|
|
23
|
+
id: string;
|
|
24
|
+
/** Component type (button, input, screen, etc.) */
|
|
25
|
+
type: UINodeType | string;
|
|
26
|
+
/** Component's address in the Olane graph */
|
|
27
|
+
address: oAddress;
|
|
28
|
+
/** Component props/configuration */
|
|
29
|
+
props: Record<string, any>;
|
|
30
|
+
/** Component internal state */
|
|
31
|
+
state: Record<string, any>;
|
|
32
|
+
/** Parent component ID (null for root screens) */
|
|
33
|
+
parentId: string | null;
|
|
34
|
+
/** Array of child component IDs */
|
|
35
|
+
childIds: string[];
|
|
36
|
+
/** Available tool methods for this component */
|
|
37
|
+
methods: string[];
|
|
38
|
+
/** Timestamp when registered */
|
|
39
|
+
registeredAt: number;
|
|
40
|
+
/** Last update timestamp */
|
|
41
|
+
updatedAt: number;
|
|
42
|
+
/** Component metadata */
|
|
43
|
+
metadata?: {
|
|
44
|
+
screenName?: string;
|
|
45
|
+
routePath?: string;
|
|
46
|
+
visible?: boolean;
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
[key: string]: any;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Request to register a component
|
|
53
|
+
*/
|
|
54
|
+
export interface RegisterComponentRequest {
|
|
55
|
+
id: string;
|
|
56
|
+
type: UINodeType | string;
|
|
57
|
+
address: string;
|
|
58
|
+
props?: Record<string, any>;
|
|
59
|
+
state?: Record<string, any>;
|
|
60
|
+
parentId?: string | null;
|
|
61
|
+
methods?: string[];
|
|
62
|
+
metadata?: Record<string, any>;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Response from component registration
|
|
66
|
+
*/
|
|
67
|
+
export interface RegisterComponentResponse {
|
|
68
|
+
success: boolean;
|
|
69
|
+
nodeId: string;
|
|
70
|
+
address: string;
|
|
71
|
+
message?: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Request to update component
|
|
75
|
+
*/
|
|
76
|
+
export interface UpdateComponentRequest {
|
|
77
|
+
nodeId: string;
|
|
78
|
+
props?: Record<string, any>;
|
|
79
|
+
state?: Record<string, any>;
|
|
80
|
+
metadata?: Record<string, any>;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Request to invoke component action
|
|
84
|
+
*/
|
|
85
|
+
export interface InvokeActionRequest {
|
|
86
|
+
nodeId: string;
|
|
87
|
+
method: string;
|
|
88
|
+
params?: any;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Response from component query
|
|
92
|
+
*/
|
|
93
|
+
export interface QueryHierarchyResponse {
|
|
94
|
+
node: ComponentNode;
|
|
95
|
+
children: ComponentNode[];
|
|
96
|
+
parent: ComponentNode | null;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Component method handler
|
|
100
|
+
*/
|
|
101
|
+
export type ComponentMethodHandler = (params?: any) => Promise<any> | any;
|
|
102
|
+
/**
|
|
103
|
+
* Component method registry
|
|
104
|
+
*/
|
|
105
|
+
export interface ComponentMethodRegistry {
|
|
106
|
+
[nodeId: string]: {
|
|
107
|
+
[method: string]: ComponentMethodHandler;
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ui/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UI component node types
|
|
3
|
+
*/
|
|
4
|
+
export var UINodeType;
|
|
5
|
+
(function (UINodeType) {
|
|
6
|
+
UINodeType["SCREEN"] = "screen";
|
|
7
|
+
UINodeType["BUTTON"] = "button";
|
|
8
|
+
UINodeType["INPUT"] = "input";
|
|
9
|
+
UINodeType["TEXT"] = "text";
|
|
10
|
+
UINodeType["VIEW"] = "view";
|
|
11
|
+
UINodeType["MODAL"] = "modal";
|
|
12
|
+
UINodeType["BOTTOM_SHEET"] = "bottom_sheet";
|
|
13
|
+
UINodeType["FORM"] = "form";
|
|
14
|
+
UINodeType["LIST"] = "list";
|
|
15
|
+
UINodeType["LIST_ITEM"] = "list_item";
|
|
16
|
+
UINodeType["CUSTOM"] = "custom";
|
|
17
|
+
})(UINodeType || (UINodeType = {}));
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { oNodeTool } from '../o-node.tool';
|
|
2
|
+
import { oRequest } from '../../../o-core/src';
|
|
3
|
+
import { ComponentNode, RegisterComponentResponse, QueryHierarchyResponse } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* UIGraphManager manages the hierarchical graph of UI components
|
|
6
|
+
* Acts as a centralized registry for all UI elements in the application
|
|
7
|
+
*/
|
|
8
|
+
export declare class UIGraphManager extends oNodeTool {
|
|
9
|
+
private componentRegistry;
|
|
10
|
+
private methodHandlers;
|
|
11
|
+
/**
|
|
12
|
+
* Register a new UI component in the graph
|
|
13
|
+
*/
|
|
14
|
+
_tool_register_component(request: oRequest): Promise<RegisterComponentResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* Unregister a UI component from the graph
|
|
17
|
+
*/
|
|
18
|
+
_tool_unregister_component(request: oRequest): Promise<{
|
|
19
|
+
success: boolean;
|
|
20
|
+
message: string;
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* Update component props, state, or metadata
|
|
24
|
+
*/
|
|
25
|
+
_tool_update_component(request: oRequest): Promise<{
|
|
26
|
+
success: boolean;
|
|
27
|
+
message: string;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* Invoke a method on a component
|
|
31
|
+
*/
|
|
32
|
+
_tool_invoke_action(request: oRequest): Promise<any>;
|
|
33
|
+
/**
|
|
34
|
+
* Query component hierarchy
|
|
35
|
+
*/
|
|
36
|
+
_tool_query_hierarchy(request: oRequest): Promise<QueryHierarchyResponse>;
|
|
37
|
+
/**
|
|
38
|
+
* Get all registered components (for debugging)
|
|
39
|
+
*/
|
|
40
|
+
_tool_list_components(request: oRequest): Promise<{
|
|
41
|
+
components: ComponentNode[];
|
|
42
|
+
count: number;
|
|
43
|
+
}>;
|
|
44
|
+
/**
|
|
45
|
+
* Get component tree structure
|
|
46
|
+
*/
|
|
47
|
+
_tool_get_tree(request: oRequest): Promise<any>;
|
|
48
|
+
/**
|
|
49
|
+
* Register a method handler for a component
|
|
50
|
+
* This is called from the client side to register callbacks
|
|
51
|
+
*/
|
|
52
|
+
registerMethodHandler(nodeId: string, method: string, handler: (params?: any) => Promise<any> | any): void;
|
|
53
|
+
/**
|
|
54
|
+
* Unregister all method handlers for a component
|
|
55
|
+
*/
|
|
56
|
+
unregisterMethodHandlers(nodeId: string): void;
|
|
57
|
+
/**
|
|
58
|
+
* Get component by ID
|
|
59
|
+
*/
|
|
60
|
+
getComponent(nodeId: string): ComponentNode | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Get all children of a component
|
|
63
|
+
*/
|
|
64
|
+
getComponentChildren(nodeId: string): ComponentNode[];
|
|
65
|
+
/**
|
|
66
|
+
* Get parent of a component
|
|
67
|
+
*/
|
|
68
|
+
getParent(nodeId: string): ComponentNode | null;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=ui-graph.manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-graph.manager.d.ts","sourceRoot":"","sources":["../../../../src/ui/ui-graph.manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,EACL,aAAa,EAEb,yBAAyB,EAGzB,sBAAsB,EAEvB,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,qBAAa,cAAe,SAAQ,SAAS;IAC3C,OAAO,CAAC,iBAAiB,CAAyC;IAClE,OAAO,CAAC,cAAc,CAA+B;IAErD;;OAEG;IACG,wBAAwB,CAC5B,OAAO,EAAE,QAAQ,GAChB,OAAO,CAAC,yBAAyB,CAAC;IA8ErC;;OAEG;IACG,0BAA0B,CAC9B,OAAO,EAAE,QAAQ,GAChB,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAiDjD;;OAEG;IACG,sBAAsB,CAC1B,OAAO,EAAE,QAAQ,GAChB,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAqCjD;;OAEG;IACG,mBAAmB,CACvB,OAAO,EAAE,QAAQ,GAChB,OAAO,CAAC,GAAG,CAAC;IAiCf;;OAEG;IACG,qBAAqB,CACzB,OAAO,EAAE,QAAQ,GAChB,OAAO,CAAC,sBAAsB,CAAC;IAyBlC;;OAEG;IACG,qBAAqB,CACzB,OAAO,EAAE,QAAQ,GAChB,OAAO,CAAC;QAAE,UAAU,EAAE,aAAa,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAS1D;;OAEG;IACG,cAAc,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IA2BrD;;;OAGG;IACI,qBAAqB,CAC1B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,GAC5C,IAAI;IAQP;;OAEG;IACI,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAKrD;;OAEG;IACI,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAI9D;;OAEG;IACI,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,EAAE;IAS5D;;OAEG;IACI,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI;CAMvD"}
|