@hydranium/data-client-theia 1.0.0-next.10
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/LICENSE +21 -0
- package/README.md +126 -0
- package/lib/browser/channel-connection.d.ts +174 -0
- package/lib/browser/channel-connection.d.ts.map +1 -0
- package/lib/browser/channel-connection.js +264 -0
- package/lib/browser/channel-connection.js.map +1 -0
- package/lib/browser/data-service-frontend.d.ts +154 -0
- package/lib/browser/data-service-frontend.d.ts.map +1 -0
- package/lib/browser/data-service-frontend.js +169 -0
- package/lib/browser/data-service-frontend.js.map +1 -0
- package/lib/browser/diagnostics-data-service-frontend.d.ts +35 -0
- package/lib/browser/diagnostics-data-service-frontend.d.ts.map +1 -0
- package/lib/browser/diagnostics-data-service-frontend.js +54 -0
- package/lib/browser/diagnostics-data-service-frontend.js.map +1 -0
- package/lib/browser/host-diagnostics-frontend.d.ts +19 -0
- package/lib/browser/host-diagnostics-frontend.d.ts.map +1 -0
- package/lib/browser/host-diagnostics-frontend.js +31 -0
- package/lib/browser/host-diagnostics-frontend.js.map +1 -0
- package/lib/browser/index.d.ts +15 -0
- package/lib/browser/index.d.ts.map +1 -0
- package/lib/browser/index.js +31 -0
- package/lib/browser/index.js.map +1 -0
- package/lib/browser/references-data-service-frontend.d.ts +45 -0
- package/lib/browser/references-data-service-frontend.d.ts.map +1 -0
- package/lib/browser/references-data-service-frontend.js +55 -0
- package/lib/browser/references-data-service-frontend.js.map +1 -0
- package/lib/browser/workspace-gate.d.ts +21 -0
- package/lib/browser/workspace-gate.d.ts.map +1 -0
- package/lib/browser/workspace-gate.js +36 -0
- package/lib/browser/workspace-gate.js.map +1 -0
- package/lib/common/emitter-data-client.d.ts +40 -0
- package/lib/common/emitter-data-client.d.ts.map +1 -0
- package/lib/common/emitter-data-client.js +49 -0
- package/lib/common/emitter-data-client.js.map +1 -0
- package/lib/common/index.d.ts +10 -0
- package/lib/common/index.d.ts.map +1 -0
- package/lib/common/index.js +37 -0
- package/lib/common/index.js.map +1 -0
- package/lib/index.d.ts +10 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +11 -0
- package/lib/index.js.map +1 -0
- package/lib/node/connection-container-module.d.ts +34 -0
- package/lib/node/connection-container-module.d.ts.map +1 -0
- package/lib/node/connection-container-module.js +53 -0
- package/lib/node/connection-container-module.js.map +1 -0
- package/lib/node/data-server-connection-handler.d.ts +56 -0
- package/lib/node/data-server-connection-handler.d.ts.map +1 -0
- package/lib/node/data-server-connection-handler.js +63 -0
- package/lib/node/data-server-connection-handler.js.map +1 -0
- package/lib/node/host-diagnostics-server.d.ts +31 -0
- package/lib/node/host-diagnostics-server.d.ts.map +1 -0
- package/lib/node/host-diagnostics-server.js +62 -0
- package/lib/node/host-diagnostics-server.js.map +1 -0
- package/lib/node/index.d.ts +13 -0
- package/lib/node/index.d.ts.map +1 -0
- package/lib/node/index.js +29 -0
- package/lib/node/index.js.map +1 -0
- package/lib/node/socket-channel-forwarder.d.ts +34 -0
- package/lib/node/socket-channel-forwarder.d.ts.map +1 -0
- package/lib/node/socket-channel-forwarder.js +63 -0
- package/lib/node/socket-channel-forwarder.js.map +1 -0
- package/package.json +101 -0
- package/src/browser/channel-connection.ts +413 -0
- package/src/browser/data-service-frontend.ts +208 -0
- package/src/browser/diagnostics-data-service-frontend.ts +70 -0
- package/src/browser/host-diagnostics-frontend.ts +30 -0
- package/src/browser/index.ts +15 -0
- package/src/browser/references-data-service-frontend.ts +70 -0
- package/src/browser/workspace-gate.ts +35 -0
- package/src/common/emitter-data-client.ts +64 -0
- package/src/common/index.ts +21 -0
- package/src/index.ts +18 -0
- package/src/node/connection-container-module.ts +51 -0
- package/src/node/data-server-connection-handler.ts +76 -0
- package/src/node/host-diagnostics-server.ts +57 -0
- package/src/node/index.ts +13 -0
- package/src/node/socket-channel-forwarder.ts +64 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the MIT License which is available in the project root.
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: MIT
|
|
9
|
+
********************************************************************************/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.AbstractReferencesDataServiceFrontend = void 0;
|
|
12
|
+
const data_service_frontend_1 = require("./data-service-frontend");
|
|
13
|
+
/**
|
|
14
|
+
* {@link AbstractDataServiceFrontend} specialised for a server that also
|
|
15
|
+
* composes the framework {@link ReferenceServerProtocol} fragment. It
|
|
16
|
+
* implements each reference method as a readiness-gated pass-through —
|
|
17
|
+
* `await this.ensureConnected()`, then delegate to `this.server` — so an
|
|
18
|
+
* adopter frontend gets the candidate / resolve / next-name surface without
|
|
19
|
+
* hand-writing identical one-liner bodies.
|
|
20
|
+
*
|
|
21
|
+
* The sibling of `AbstractDiagnosticsDataServiceFrontend`, and the same
|
|
22
|
+
* shape for the same reason: `this.server` is already a forwarding proxy, but
|
|
23
|
+
* it queues only on the channel being live, not on the server's `waitForReady`
|
|
24
|
+
* gate — so the gate has to be interposed per method.
|
|
25
|
+
*
|
|
26
|
+
* Extend this instead of {@link AbstractDataServiceFrontend} whenever the
|
|
27
|
+
* head's `DataServer` registers the reference fragment (typically via a
|
|
28
|
+
* subclass's `additionalMethods`, since
|
|
29
|
+
* `REFERENCE_SERVER_PROTOCOL_METHODS` is deliberately NOT part of
|
|
30
|
+
* `DATA_SERVER_PROTOCOL_METHODS`). The `TServer` bound carries
|
|
31
|
+
* `ReferenceServerProtocol`, so the delegates are type-checked without casts.
|
|
32
|
+
*
|
|
33
|
+
* A frontend needing both fragments extends the diagnostics base and mixes
|
|
34
|
+
* these three in, or vice versa — TypeScript allows only one base class, so
|
|
35
|
+
* the two bases are deliberately independent rather than chained. Chaining
|
|
36
|
+
* them would force every reference-fragment adopter to also carry the
|
|
37
|
+
* diagnostics surface, which a head that dropped those methods via
|
|
38
|
+
* `DataServerOptions.excludedMethods` cannot satisfy.
|
|
39
|
+
*/
|
|
40
|
+
class AbstractReferencesDataServiceFrontend extends data_service_frontend_1.AbstractDataServiceFrontend {
|
|
41
|
+
async findReferenceCandidates(ctx) {
|
|
42
|
+
await this.ensureConnected();
|
|
43
|
+
return this.server.findReferenceCandidates(ctx);
|
|
44
|
+
}
|
|
45
|
+
async resolveReference(ref) {
|
|
46
|
+
await this.ensureConnected();
|
|
47
|
+
return this.server.resolveReference(ref);
|
|
48
|
+
}
|
|
49
|
+
async findNextName(args) {
|
|
50
|
+
await this.ensureConnected();
|
|
51
|
+
return this.server.findNextName(args);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.AbstractReferencesDataServiceFrontend = AbstractReferencesDataServiceFrontend;
|
|
55
|
+
//# sourceMappingURL=references-data-service-frontend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"references-data-service-frontend.js","sourceRoot":"","sources":["../../src/browser/references-data-service-frontend.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAWlF,mEAAsE;AAEtE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAsB,qCAKnB,SAAQ,mDAA6C;IAGrD,KAAK,CAAC,uBAAuB,CAAC,GAAqB;QAChD,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC,MAAM,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,GAAqB;QACzC,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,IAAsB;QACtC,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;CACH;AAtBD,sFAsBC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
import { type WorkspaceService } from '@theia/workspace/lib/browser';
|
|
10
|
+
/**
|
|
11
|
+
* Resolve once a workspace is open (one or more roots present). Resolves
|
|
12
|
+
* immediately if a workspace is already open, otherwise on the first
|
|
13
|
+
* `onWorkspaceChanged` that reports roots — the listener disposes itself.
|
|
14
|
+
*
|
|
15
|
+
* The common Theia gate for a data-server head: the model-server only starts
|
|
16
|
+
* once the LSP launches for a workspace, so connecting earlier would hang on
|
|
17
|
+
* port discovery. Pass the returned promise as
|
|
18
|
+
* `OpenChannelConnectionOptions.whenReady`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function whenWorkspaceOpen(workspaceService: WorkspaceService): Promise<void>;
|
|
21
|
+
//# sourceMappingURL=workspace-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-gate.d.ts","sourceRoot":"","sources":["../../src/browser/workspace-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAanF"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the MIT License which is available in the project root.
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: MIT
|
|
9
|
+
********************************************************************************/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.whenWorkspaceOpen = whenWorkspaceOpen;
|
|
12
|
+
/**
|
|
13
|
+
* Resolve once a workspace is open (one or more roots present). Resolves
|
|
14
|
+
* immediately if a workspace is already open, otherwise on the first
|
|
15
|
+
* `onWorkspaceChanged` that reports roots — the listener disposes itself.
|
|
16
|
+
*
|
|
17
|
+
* The common Theia gate for a data-server head: the model-server only starts
|
|
18
|
+
* once the LSP launches for a workspace, so connecting earlier would hang on
|
|
19
|
+
* port discovery. Pass the returned promise as
|
|
20
|
+
* `OpenChannelConnectionOptions.whenReady`.
|
|
21
|
+
*/
|
|
22
|
+
function whenWorkspaceOpen(workspaceService) {
|
|
23
|
+
const roots = workspaceService.tryGetRoots();
|
|
24
|
+
if (roots && roots.length > 0) {
|
|
25
|
+
return Promise.resolve();
|
|
26
|
+
}
|
|
27
|
+
return new Promise(resolve => {
|
|
28
|
+
const disposable = workspaceService.onWorkspaceChanged(changedRoots => {
|
|
29
|
+
if (changedRoots && changedRoots.length > 0) {
|
|
30
|
+
disposable.dispose();
|
|
31
|
+
resolve();
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=workspace-gate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-gate.js","sourceRoot":"","sources":["../../src/browser/workspace-gate.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;AAclF,8CAaC;AAvBD;;;;;;;;;GASG;AACH,SAAgB,iBAAiB,CAAC,gBAAkC;IACjE,MAAM,KAAK,GAAG,gBAAgB,CAAC,WAAW,EAAE,CAAC;IAC7C,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7B,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC5B,CAAC;IACD,OAAO,IAAI,OAAO,CAAO,OAAO,CAAC,EAAE;QAChC,MAAM,UAAU,GAAG,gBAAgB,CAAC,kBAAkB,CAAC,YAAY,CAAC,EAAE;YACnE,IAAI,YAAY,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC3C,UAAU,CAAC,OAAO,EAAE,CAAC;gBACrB,OAAO,EAAE,CAAC;YACb,CAAC;QACJ,CAAC,CAAC,CAAC;IACN,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
import type { DataClientProtocol, Project, ProjectsChangedEvent, TransferDiagnostic, TransferDocumentSavedEvent, TransferDocumentUpdatedEvent, TransferElement } from '@hydranium/protocol';
|
|
10
|
+
import { Emitter, type Event } from '@theia/core';
|
|
11
|
+
/**
|
|
12
|
+
* Default {@link DataClientProtocol} implementation for a Theia frontend:
|
|
13
|
+
* each inbound `on*` notification is fanned out to a Theia {@link Event} so
|
|
14
|
+
* multiple local listeners can subscribe (the framework deliberately leaves
|
|
15
|
+
* fan-out to the consumer — see `DataClientProtocol`).
|
|
16
|
+
*
|
|
17
|
+
* Bind an instance as the `localTarget` of the frontend's `createRpcProxy`
|
|
18
|
+
* (with `DATA_CLIENT_PROTOCOL_METHODS` as `localMethods`); incoming
|
|
19
|
+
* `<namespace>onDocumentUpdated` etc. dispatch to the matching method here,
|
|
20
|
+
* which fires the paired `Event`.
|
|
21
|
+
*
|
|
22
|
+
* Adopters subclass to add signals that are not wire notifications, or to
|
|
23
|
+
* expose domain-renamed aliases of these channels — the event getters stay
|
|
24
|
+
* accessible to the subclass.
|
|
25
|
+
*/
|
|
26
|
+
export declare class EmitterDataClient<TTransfer extends TransferElement, TDiagnostic extends TransferDiagnostic = TransferDiagnostic, TProject extends Project = Project> implements DataClientProtocol<TTransfer, TDiagnostic, TProject> {
|
|
27
|
+
protected readonly onDocumentUpdatedEmitter: Emitter<TransferDocumentUpdatedEvent<TTransfer, TDiagnostic>>;
|
|
28
|
+
/** Fires for each inbound {@link onDocumentUpdated} notification. */
|
|
29
|
+
readonly onDidUpdateDocument: Event<TransferDocumentUpdatedEvent<TTransfer, TDiagnostic>>;
|
|
30
|
+
protected readonly onDocumentSavedEmitter: Emitter<TransferDocumentSavedEvent<TTransfer, TDiagnostic>>;
|
|
31
|
+
/** Fires for each inbound {@link onDocumentSaved} notification. */
|
|
32
|
+
readonly onDidSaveDocument: Event<TransferDocumentSavedEvent<TTransfer, TDiagnostic>>;
|
|
33
|
+
protected readonly onProjectsChangedEmitter: Emitter<ProjectsChangedEvent<TProject>>;
|
|
34
|
+
/** Fires for each inbound {@link onProjectsChanged} notification. */
|
|
35
|
+
readonly onDidChangeProjects: Event<ProjectsChangedEvent<TProject>>;
|
|
36
|
+
onDocumentUpdated(event: TransferDocumentUpdatedEvent<TTransfer, TDiagnostic>): void;
|
|
37
|
+
onDocumentSaved(event: TransferDocumentSavedEvent<TTransfer, TDiagnostic>): void;
|
|
38
|
+
onProjectsChanged(event: ProjectsChangedEvent<TProject>): void;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=emitter-data-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emitter-data-client.d.ts","sourceRoot":"","sources":["../../src/common/emitter-data-client.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,KAAK,EACT,kBAAkB,EAClB,OAAO,EACP,oBAAoB,EACpB,kBAAkB,EAClB,0BAA0B,EAC1B,4BAA4B,EAC5B,eAAe,EACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,iBAAiB,CAC3B,SAAS,SAAS,eAAe,EACjC,WAAW,SAAS,kBAAkB,GAAG,kBAAkB,EAC3D,QAAQ,SAAS,OAAO,GAAG,OAAO,CACnC,YAAW,kBAAkB,CAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,CAAC;IAC9D,SAAS,CAAC,QAAQ,CAAC,wBAAwB,gEAAuE;IAClH,qEAAqE;IACrE,QAAQ,CAAC,mBAAmB,EAAE,KAAK,CAAC,4BAA4B,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAuC;IAEhI,SAAS,CAAC,QAAQ,CAAC,sBAAsB,8DAAqE;IAC9G,mEAAmE;IACnE,QAAQ,CAAC,iBAAiB,EAAE,KAAK,CAAC,0BAA0B,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAqC;IAE1H,SAAS,CAAC,QAAQ,CAAC,wBAAwB,0CAAiD;IAC5F,qEAAqE;IACrE,QAAQ,CAAC,mBAAmB,EAAE,KAAK,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC,CAAuC;IAE1G,iBAAiB,CAAC,KAAK,EAAE,4BAA4B,CAAC,SAAS,EAAE,WAAW,CAAC,GAAG,IAAI;IAIpF,eAAe,CAAC,KAAK,EAAE,0BAA0B,CAAC,SAAS,EAAE,WAAW,CAAC,GAAG,IAAI;IAIhF,iBAAiB,CAAC,KAAK,EAAE,oBAAoB,CAAC,QAAQ,CAAC,GAAG,IAAI;CAGhE"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the MIT License which is available in the project root.
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: MIT
|
|
9
|
+
********************************************************************************/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.EmitterDataClient = void 0;
|
|
12
|
+
const core_1 = require("@theia/core");
|
|
13
|
+
/**
|
|
14
|
+
* Default {@link DataClientProtocol} implementation for a Theia frontend:
|
|
15
|
+
* each inbound `on*` notification is fanned out to a Theia {@link Event} so
|
|
16
|
+
* multiple local listeners can subscribe (the framework deliberately leaves
|
|
17
|
+
* fan-out to the consumer — see `DataClientProtocol`).
|
|
18
|
+
*
|
|
19
|
+
* Bind an instance as the `localTarget` of the frontend's `createRpcProxy`
|
|
20
|
+
* (with `DATA_CLIENT_PROTOCOL_METHODS` as `localMethods`); incoming
|
|
21
|
+
* `<namespace>onDocumentUpdated` etc. dispatch to the matching method here,
|
|
22
|
+
* which fires the paired `Event`.
|
|
23
|
+
*
|
|
24
|
+
* Adopters subclass to add signals that are not wire notifications, or to
|
|
25
|
+
* expose domain-renamed aliases of these channels — the event getters stay
|
|
26
|
+
* accessible to the subclass.
|
|
27
|
+
*/
|
|
28
|
+
class EmitterDataClient {
|
|
29
|
+
onDocumentUpdatedEmitter = new core_1.Emitter();
|
|
30
|
+
/** Fires for each inbound {@link onDocumentUpdated} notification. */
|
|
31
|
+
onDidUpdateDocument = this.onDocumentUpdatedEmitter.event;
|
|
32
|
+
onDocumentSavedEmitter = new core_1.Emitter();
|
|
33
|
+
/** Fires for each inbound {@link onDocumentSaved} notification. */
|
|
34
|
+
onDidSaveDocument = this.onDocumentSavedEmitter.event;
|
|
35
|
+
onProjectsChangedEmitter = new core_1.Emitter();
|
|
36
|
+
/** Fires for each inbound {@link onProjectsChanged} notification. */
|
|
37
|
+
onDidChangeProjects = this.onProjectsChangedEmitter.event;
|
|
38
|
+
onDocumentUpdated(event) {
|
|
39
|
+
this.onDocumentUpdatedEmitter.fire(event);
|
|
40
|
+
}
|
|
41
|
+
onDocumentSaved(event) {
|
|
42
|
+
this.onDocumentSavedEmitter.fire(event);
|
|
43
|
+
}
|
|
44
|
+
onProjectsChanged(event) {
|
|
45
|
+
this.onProjectsChangedEmitter.fire(event);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.EmitterDataClient = EmitterDataClient;
|
|
49
|
+
//# sourceMappingURL=emitter-data-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emitter-data-client.js","sourceRoot":"","sources":["../../src/common/emitter-data-client.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAWlF,sCAAkD;AAElD;;;;;;;;;;;;;;GAcG;AACH,MAAa,iBAAiB;IAKR,wBAAwB,GAAG,IAAI,cAAO,EAAwD,CAAC;IAClH,qEAAqE;IAC5D,mBAAmB,GAAgE,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC;IAE7G,sBAAsB,GAAG,IAAI,cAAO,EAAsD,CAAC;IAC9G,mEAAmE;IAC1D,iBAAiB,GAA8D,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC;IAEvG,wBAAwB,GAAG,IAAI,cAAO,EAAkC,CAAC;IAC5F,qEAAqE;IAC5D,mBAAmB,GAA0C,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC;IAE1G,iBAAiB,CAAC,KAA2D;QAC1E,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;IAED,eAAe,CAAC,KAAyD;QACtE,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED,iBAAiB,CAAC,KAAqC;QACpD,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;CACH;AA5BD,8CA4BC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
export * from './emitter-data-client';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAalF,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the MIT License which is available in the project root.
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: MIT
|
|
9
|
+
********************************************************************************/
|
|
10
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
13
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
14
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(o, k2, desc);
|
|
17
|
+
}) : (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
o[k2] = m[k];
|
|
20
|
+
}));
|
|
21
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
22
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
// Environment-agnostic shared surface for the data-server-head Theia
|
|
26
|
+
// integration. A module lands here only when its whole dependency closure —
|
|
27
|
+
// values, types and relative imports alike — is either neutral or Theia's
|
|
28
|
+
// COMMON tier; `@theia/core`'s root entry is that tier, while anything reaching
|
|
29
|
+
// `@theia/*/lib/browser` or `/lib/node` belongs in the tier it names, even when
|
|
30
|
+
// the import is type-only and erases at runtime.
|
|
31
|
+
//
|
|
32
|
+
// This tier deliberately holds no error-reconstruction bridge, and that is a
|
|
33
|
+
// property of the transport rather than an omission: the direct vscode-jsonrpc
|
|
34
|
+
// connection carries a typed error such as `ConflictError` across the channel
|
|
35
|
+
// relay natively, with no Theia msgpack hop to drop its data.
|
|
36
|
+
__exportStar(require("./emitter-data-client"), exports);
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;;AAElF,qEAAqE;AACrE,4EAA4E;AAC5E,0EAA0E;AAC1E,gFAAgF;AAChF,gFAAgF;AAChF,iDAAiD;AACjD,EAAE;AACF,6EAA6E;AAC7E,+EAA+E;AAC/E,8EAA8E;AAC9E,8DAA8D;AAC9D,wDAAsC"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAUlF,OAAO,EAAE,CAAC"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the MIT License which is available in the project root.
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: MIT
|
|
9
|
+
********************************************************************************/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
import { ConnectionHandler } from '@theia/core';
|
|
10
|
+
import { ContainerModule, type interfaces } from '@theia/core/shared/inversify';
|
|
11
|
+
/**
|
|
12
|
+
* Creates the frontend-scoped Theia backend module that registers a
|
|
13
|
+
* data-server {@link ConnectionHandler} (a `DataServerConnectionHandler`
|
|
14
|
+
* subclass) per browser-frontend connection. Returns a ready-to-export
|
|
15
|
+
* `ContainerModule` so adopters can
|
|
16
|
+
* `export default createDataServerConnectionContainerModule(MyHandler)` from
|
|
17
|
+
* their backend-module entry point.
|
|
18
|
+
*
|
|
19
|
+
* Sibling of `@hydranium/glsp-client-theia`'s
|
|
20
|
+
* `createGlspConnectionContainerModule` — the `ContainerModule +
|
|
21
|
+
* ConnectionContainerModule.create` boilerplate every frontend-scoped Theia
|
|
22
|
+
* connection adopter writes by hand, lifted so adopters declare only the
|
|
23
|
+
* handler class.
|
|
24
|
+
*
|
|
25
|
+
* **More than one handler is the normal case, not an exotic one.** Theia keys a
|
|
26
|
+
* frontend channel by its service path and refuses a second channel on a path
|
|
27
|
+
* already open, so every frontend abstraction reaching the data head needs its
|
|
28
|
+
* own path and therefore its own handler — a host-neutral `DataPort` beside a
|
|
29
|
+
* Theia `AbstractDataServiceFrontend` is exactly that shape. They still forward
|
|
30
|
+
* to the SAME data server: the path distinguishes the channel, the shared
|
|
31
|
+
* `portCommand` names the one process behind it.
|
|
32
|
+
*/
|
|
33
|
+
export declare function createDataServerConnectionContainerModule(...handlerClasses: interfaces.Newable<ConnectionHandler>[]): ContainerModule;
|
|
34
|
+
//# sourceMappingURL=connection-container-module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection-container-module.d.ts","sourceRoot":"","sources":["../../src/node/connection-container-module.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,KAAK,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAEhF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,yCAAyC,CAAC,GAAG,cAAc,EAAE,UAAU,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,GAAG,eAAe,CAerI"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the MIT License which is available in the project root.
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: MIT
|
|
9
|
+
********************************************************************************/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.createDataServerConnectionContainerModule = createDataServerConnectionContainerModule;
|
|
12
|
+
const core_1 = require("@theia/core");
|
|
13
|
+
const connection_container_module_1 = require("@theia/core/lib/node/messaging/connection-container-module");
|
|
14
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
15
|
+
/**
|
|
16
|
+
* Creates the frontend-scoped Theia backend module that registers a
|
|
17
|
+
* data-server {@link ConnectionHandler} (a `DataServerConnectionHandler`
|
|
18
|
+
* subclass) per browser-frontend connection. Returns a ready-to-export
|
|
19
|
+
* `ContainerModule` so adopters can
|
|
20
|
+
* `export default createDataServerConnectionContainerModule(MyHandler)` from
|
|
21
|
+
* their backend-module entry point.
|
|
22
|
+
*
|
|
23
|
+
* Sibling of `@hydranium/glsp-client-theia`'s
|
|
24
|
+
* `createGlspConnectionContainerModule` — the `ContainerModule +
|
|
25
|
+
* ConnectionContainerModule.create` boilerplate every frontend-scoped Theia
|
|
26
|
+
* connection adopter writes by hand, lifted so adopters declare only the
|
|
27
|
+
* handler class.
|
|
28
|
+
*
|
|
29
|
+
* **More than one handler is the normal case, not an exotic one.** Theia keys a
|
|
30
|
+
* frontend channel by its service path and refuses a second channel on a path
|
|
31
|
+
* already open, so every frontend abstraction reaching the data head needs its
|
|
32
|
+
* own path and therefore its own handler — a host-neutral `DataPort` beside a
|
|
33
|
+
* Theia `AbstractDataServiceFrontend` is exactly that shape. They still forward
|
|
34
|
+
* to the SAME data server: the path distinguishes the channel, the shared
|
|
35
|
+
* `portCommand` names the one process behind it.
|
|
36
|
+
*/
|
|
37
|
+
function createDataServerConnectionContainerModule(...handlerClasses) {
|
|
38
|
+
const frontendScopedConnectionModule = connection_container_module_1.ConnectionContainerModule.create(({ bind }) => {
|
|
39
|
+
for (const handlerClass of handlerClasses) {
|
|
40
|
+
bind(handlerClass).toSelf().inSingletonScope();
|
|
41
|
+
// `toDynamicValue` over `to(handlerClass)`: `ConnectionHandler` is
|
|
42
|
+
// multi-bound here, and resolving through the container keeps each
|
|
43
|
+
// entry the SAME singleton the adopter can inject by its own class.
|
|
44
|
+
bind(core_1.ConnectionHandler)
|
|
45
|
+
.toDynamicValue(context => context.container.get(handlerClass))
|
|
46
|
+
.inSingletonScope();
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
return new inversify_1.ContainerModule(bind => {
|
|
50
|
+
bind(connection_container_module_1.ConnectionContainerModule).toConstantValue(frontendScopedConnectionModule);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=connection-container-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection-container-module.js","sourceRoot":"","sources":["../../src/node/connection-container-module.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;AA4BlF,8FAeC;AAzCD,sCAAgD;AAChD,4GAAuG;AACvG,4DAAgF;AAEhF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,yCAAyC,CAAC,GAAG,cAAuD;IACjH,MAAM,8BAA8B,GAAG,uDAAyB,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;QAClF,KAAK,MAAM,YAAY,IAAI,cAAc,EAAE,CAAC;YACzC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;YAC/C,mEAAmE;YACnE,mEAAmE;YACnE,oEAAoE;YACpE,IAAI,CAAC,wBAAiB,CAAC;iBACnB,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;iBAC9D,gBAAgB,EAAE,CAAC;QAC1B,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;QAC/B,IAAI,CAAC,uDAAyB,CAAC,CAAC,eAAe,CAAC,8BAA8B,CAAC,CAAC;IACnF,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
import { AbstractSocketForwardingConnectionHandler } from '@hydranium/client-theia/lib/node';
|
|
10
|
+
import { type Channel, type Disposable } from '@theia/core';
|
|
11
|
+
import type * as net from 'node:net';
|
|
12
|
+
/** Options for {@link DataServerConnectionHandler}. `servicePath` is the Theia
|
|
13
|
+
* service path the browser frontend opens a channel to; `portCommand` is the
|
|
14
|
+
* command id whose return value is the data-server's listening port (the
|
|
15
|
+
* data-server publishes it on the LSP connection at startup, the same handshake
|
|
16
|
+
* GLSP uses). */
|
|
17
|
+
export interface DataServerConnectionHandlerOptions {
|
|
18
|
+
/** Theia service path the browser frontend opens a channel to. Defaults to
|
|
19
|
+
* the framework `DATA_SERVER_PATH`; override for an adopter-specific path,
|
|
20
|
+
* and NECESSARILY when a second frontend reaches the same head — Theia
|
|
21
|
+
* refuses a second channel on a path already open, so paths are per
|
|
22
|
+
* FRONTEND while `portCommand` stays per server. */
|
|
23
|
+
readonly servicePath?: string;
|
|
24
|
+
/** Command id whose return value is the data-server's listening port.
|
|
25
|
+
* Defaults to the framework `DATA_SERVER_PORT_COMMAND`; override to match
|
|
26
|
+
* an adopter's established id. */
|
|
27
|
+
readonly portCommand?: string;
|
|
28
|
+
readonly findPortTimeout?: number;
|
|
29
|
+
readonly findPortAttempts?: number;
|
|
30
|
+
readonly connectTimeoutMs?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Optional diagnostic hook called immediately after the outbound
|
|
33
|
+
* `net.Socket` to the data-server is created, BEFORE `socket.connect()` is
|
|
34
|
+
* invoked. Adopters attach `'data'` / `'close'` listeners here for
|
|
35
|
+
* byte-level observability when debugging wire-level issues; attaching
|
|
36
|
+
* before `connect()` guarantees the very first bytes are observed.
|
|
37
|
+
*/
|
|
38
|
+
readonly onSocketCreated?: (socket: net.Socket) => void;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Bridges a Theia browser-frontend channel to a data-server's TCP socket — the
|
|
42
|
+
* backend half of the data-server head's transport.
|
|
43
|
+
*
|
|
44
|
+
* The port-discovery + buffer-and-replay race fix + connect orchestration live
|
|
45
|
+
* on the cross-head {@link AbstractSocketForwardingConnectionHandler} base; this
|
|
46
|
+
* subclass supplies only the data-server defaults (service path / port command /
|
|
47
|
+
* log labels) and plugs in {@link SocketChannelForwarder} as the byte relay —
|
|
48
|
+
* its own forwarder, so the data head carries no GLSP dependency. Sibling of
|
|
49
|
+
* `@hydranium/glsp-client-theia`'s `GlspServerConnectionHandler`, which
|
|
50
|
+
* subclasses the same base with `@eclipse-glsp`'s `SocketConnectionForwarder`.
|
|
51
|
+
*/
|
|
52
|
+
export declare class DataServerConnectionHandler extends AbstractSocketForwardingConnectionHandler {
|
|
53
|
+
constructor(options?: DataServerConnectionHandlerOptions);
|
|
54
|
+
protected forwardToSocketConnection(clientChannel: Channel, socket: net.Socket): Disposable;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=data-server-connection-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-server-connection-handler.d.ts","sourceRoot":"","sources":["../../src/node/data-server-connection-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,yCAAyC,EAAE,MAAM,kCAAkC,CAAC;AAE7F,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,KAAK,KAAK,GAAG,MAAM,UAAU,CAAC;AAGrC;;;;kBAIkB;AAClB,MAAM,WAAW,kCAAkC;IAChD;;;;yDAIqD;IACrD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;uCAEmC;IACnC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC;;;;;;OAMG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,KAAK,IAAI,CAAC;CAC1D;AAED;;;;;;;;;;;GAWG;AACH,qBACa,2BAA4B,SAAQ,yCAAyC;gBAC9D,OAAO,GAAE,kCAAuC;IAazE,SAAS,CAAC,yBAAyB,CAAC,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,UAAU;CAG7F"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the MIT License which is available in the project root.
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: MIT
|
|
9
|
+
********************************************************************************/
|
|
10
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
11
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
12
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
13
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
14
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15
|
+
};
|
|
16
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
17
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
18
|
+
};
|
|
19
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
20
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.DataServerConnectionHandler = void 0;
|
|
24
|
+
const node_1 = require("@hydranium/client-theia/lib/node");
|
|
25
|
+
const protocol_1 = require("@hydranium/protocol");
|
|
26
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
27
|
+
const socket_channel_forwarder_1 = require("./socket-channel-forwarder");
|
|
28
|
+
/**
|
|
29
|
+
* Bridges a Theia browser-frontend channel to a data-server's TCP socket — the
|
|
30
|
+
* backend half of the data-server head's transport.
|
|
31
|
+
*
|
|
32
|
+
* The port-discovery + buffer-and-replay race fix + connect orchestration live
|
|
33
|
+
* on the cross-head {@link AbstractSocketForwardingConnectionHandler} base; this
|
|
34
|
+
* subclass supplies only the data-server defaults (service path / port command /
|
|
35
|
+
* log labels) and plugs in {@link SocketChannelForwarder} as the byte relay —
|
|
36
|
+
* its own forwarder, so the data head carries no GLSP dependency. Sibling of
|
|
37
|
+
* `@hydranium/glsp-client-theia`'s `GlspServerConnectionHandler`, which
|
|
38
|
+
* subclasses the same base with `@eclipse-glsp`'s `SocketConnectionForwarder`.
|
|
39
|
+
*/
|
|
40
|
+
let DataServerConnectionHandler = class DataServerConnectionHandler extends node_1.AbstractSocketForwardingConnectionHandler {
|
|
41
|
+
constructor(options = {}) {
|
|
42
|
+
super({
|
|
43
|
+
path: options.servicePath ?? protocol_1.DATA_SERVER_PATH,
|
|
44
|
+
portCommand: options.portCommand ?? protocol_1.DATA_SERVER_PORT_COMMAND,
|
|
45
|
+
logComponent: 'DataServer',
|
|
46
|
+
serverName: 'Model Server',
|
|
47
|
+
findPortTimeout: options.findPortTimeout,
|
|
48
|
+
findPortAttempts: options.findPortAttempts,
|
|
49
|
+
connectTimeoutMs: options.connectTimeoutMs,
|
|
50
|
+
onSocketCreated: options.onSocketCreated
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
forwardToSocketConnection(clientChannel, socket) {
|
|
54
|
+
return new socket_channel_forwarder_1.SocketChannelForwarder(clientChannel, socket);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
exports.DataServerConnectionHandler = DataServerConnectionHandler;
|
|
58
|
+
exports.DataServerConnectionHandler = DataServerConnectionHandler = __decorate([
|
|
59
|
+
(0, inversify_1.injectable)(),
|
|
60
|
+
__param(0, (0, inversify_1.unmanaged)()),
|
|
61
|
+
__metadata("design:paramtypes", [Object])
|
|
62
|
+
], DataServerConnectionHandler);
|
|
63
|
+
//# sourceMappingURL=data-server-connection-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-server-connection-handler.js","sourceRoot":"","sources":["../../src/node/data-server-connection-handler.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;AAElF,2DAA6F;AAC7F,kDAAiF;AAEjF,4DAAqE;AAErE,yEAAoE;AA+BpE;;;;;;;;;;;GAWG;AAEI,IAAM,2BAA2B,GAAjC,MAAM,2BAA4B,SAAQ,gDAAyC;IACvF,YAAyB,UAA8C,EAAE;QACtE,KAAK,CAAC;YACH,IAAI,EAAE,OAAO,CAAC,WAAW,IAAI,2BAAgB;YAC7C,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,mCAAwB;YAC5D,YAAY,EAAE,YAAY;YAC1B,UAAU,EAAE,cAAc;YAC1B,eAAe,EAAE,OAAO,CAAC,eAAe;YACxC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;YAC1C,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;YAC1C,eAAe,EAAE,OAAO,CAAC,eAAe;SAC1C,CAAC,CAAC;IACN,CAAC;IAES,yBAAyB,CAAC,aAAsB,EAAE,MAAkB;QAC3E,OAAO,IAAI,iDAAsB,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IAC5D,CAAC;CACH,CAAA;AAjBY,kEAA2B;sCAA3B,2BAA2B;IADvC,IAAA,sBAAU,GAAE;IAEG,WAAA,IAAA,qBAAS,GAAE,CAAA;;GADd,2BAA2B,CAiBvC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
import { type DumpHostStateArgs, type HostDiagnosticsProtocol, type WriteHostHeapSnapshotArgs } from '@hydranium/protocol';
|
|
10
|
+
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
11
|
+
/**
|
|
12
|
+
* Host-process diagnostics, computed IN the Theia backend process this service
|
|
13
|
+
* runs in (the parent / host, distinct from the data-server child that holds the
|
|
14
|
+
* model store). Universal — `process.memoryUsage()` always works — so the
|
|
15
|
+
* framework wires it by default. Each result is also written to the backend's
|
|
16
|
+
* stdout so it reaches the pod log (`kubectl logs`), not only the RPC caller.
|
|
17
|
+
*/
|
|
18
|
+
export declare class HostDiagnosticsServer implements HostDiagnosticsProtocol {
|
|
19
|
+
dumpHostState(args: DumpHostStateArgs): Promise<string>;
|
|
20
|
+
writeHostHeapSnapshot(args: WriteHostHeapSnapshotArgs): Promise<string>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Theia backend module that exposes {@link HostDiagnosticsServer} as an ordinary
|
|
24
|
+
* in-process RPC service at {@link HOST_DIAGNOSTICS_PATH} (not the socket-
|
|
25
|
+
* forwarded data-server transport). The frontend reaches it with
|
|
26
|
+
* `bindHostDiagnostics` (see `../browser`). Adopters
|
|
27
|
+
* `export default createHostDiagnosticsBackendModule()` from a backend-module
|
|
28
|
+
* entry point.
|
|
29
|
+
*/
|
|
30
|
+
export declare function createHostDiagnosticsBackendModule(): ContainerModule;
|
|
31
|
+
//# sourceMappingURL=host-diagnostics-server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-diagnostics-server.d.ts","sourceRoot":"","sources":["../../src/node/host-diagnostics-server.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EAEJ,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAChC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,eAAe,EAAc,MAAM,8BAA8B,CAAC;AAE3E;;;;;;GAMG;AACH,qBACa,qBAAsB,YAAW,uBAAuB;IAC5D,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC;IAMvD,qBAAqB,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC;CAK/E;AAED;;;;;;;GAOG;AACH,wBAAgB,kCAAkC,IAAI,eAAe,CAOpE"}
|