@rynx-ai/daemon 0.1.0 → 0.1.9
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/browser-cli-args.d.ts +20 -0
- package/dist/browser-cli-args.js +100 -0
- package/dist/browser-runner-session-context.d.ts +24 -0
- package/dist/browser-runner-session-context.js +113 -0
- package/dist/cdp-keyboard-input.d.ts +6 -0
- package/dist/cdp-keyboard-input.js +209 -0
- package/dist/channel-store.d.ts +0 -6
- package/dist/channel-store.js +2 -18
- package/dist/chrome-for-testing-release-resolver.d.ts +34 -0
- package/dist/chrome-for-testing-release-resolver.js +214 -0
- package/dist/chrome-for-testing-store.d.ts +85 -0
- package/dist/chrome-for-testing-store.js +836 -0
- package/dist/cli.js +467 -30
- package/dist/control-client.d.ts +113 -0
- package/dist/control-client.js +792 -0
- package/dist/control-deps.js +37 -6
- package/dist/control-endpoint.d.ts +14 -0
- package/dist/control-endpoint.js +124 -0
- package/dist/control-link-store.d.ts +16 -0
- package/dist/control-link-store.js +53 -0
- package/dist/daemon-owner.d.ts +14 -0
- package/dist/daemon-owner.js +104 -0
- package/dist/daemon-server.d.ts +12 -2
- package/dist/daemon-server.js +559 -28
- package/dist/db.js +140 -10
- package/dist/desktop-browser-host-client.d.ts +34 -0
- package/dist/desktop-browser-host-client.js +413 -0
- package/dist/direct-runtime-authenticator.d.ts +13 -0
- package/dist/direct-runtime-authenticator.js +127 -0
- package/dist/direct-runtime-config.d.ts +20 -0
- package/dist/direct-runtime-config.js +101 -0
- package/dist/embedded-browser-profile-cleanup.d.ts +58 -0
- package/dist/embedded-browser-profile-cleanup.js +338 -0
- package/dist/headless-browser-host.d.ts +14 -0
- package/dist/headless-browser-host.js +2156 -0
- package/dist/index-daemon.js +28 -5
- package/dist/installation-id.d.ts +33 -0
- package/dist/installation-id.js +692 -0
- package/dist/migrations/cleanup-legacy-sessions.d.ts +0 -3
- package/dist/migrations/cleanup-legacy-sessions.js +10 -28
- package/dist/plugin-cli.d.ts +30 -0
- package/dist/plugin-cli.js +270 -0
- package/dist/plugin-host-rpc.d.ts +85 -0
- package/dist/plugin-host-rpc.js +878 -0
- package/dist/plugin-install-restart.d.ts +13 -0
- package/dist/plugin-install-restart.js +24 -0
- package/dist/plugin-installer.d.ts +36 -15
- package/dist/plugin-installer.js +420 -155
- package/dist/plugin-package.d.ts +38 -0
- package/dist/plugin-package.js +553 -0
- package/dist/plugin-runtime-control.d.ts +2 -0
- package/dist/plugin-runtime-control.js +37 -0
- package/dist/plugin-store.d.ts +37 -8
- package/dist/plugin-store.js +80 -15
- package/dist/plugin-supervisor.d.ts +160 -0
- package/dist/plugin-supervisor.js +1143 -0
- package/dist/pm2.d.ts +3 -1
- package/dist/pm2.js +55 -13
- package/dist/provider-cli-service.d.ts +46 -0
- package/dist/provider-cli-service.js +510 -0
- package/dist/registry.d.ts +6 -19
- package/dist/registry.js +22 -87
- package/dist/remote-runtime-access-store.d.ts +61 -0
- package/dist/remote-runtime-access-store.js +386 -0
- package/dist/remote-runtime-admin.d.ts +32 -0
- package/dist/remote-runtime-admin.js +107 -0
- package/dist/remote-runtime-connection-manager.d.ts +92 -0
- package/dist/remote-runtime-connection-manager.js +1409 -0
- package/dist/remote-runtime-credential-store.d.ts +45 -0
- package/dist/remote-runtime-credential-store.js +639 -0
- package/dist/remote-runtime-target-control.d.ts +47 -0
- package/dist/remote-runtime-target-control.js +433 -0
- package/dist/remote-runtime-target-store.d.ts +53 -0
- package/dist/remote-runtime-target-store.js +307 -0
- package/dist/runtime-share-addresses.d.ts +21 -0
- package/dist/runtime-share-addresses.js +50 -0
- package/dist/session-browser-capability-store.d.ts +13 -0
- package/dist/session-browser-capability-store.js +58 -0
- package/dist/session-emulator-binding-store.d.ts +10 -0
- package/dist/session-emulator-binding-store.js +61 -0
- package/dist/session-launch-operations.d.ts +41 -0
- package/dist/session-launch-operations.js +124 -0
- package/dist/session-meta-store.d.ts +3 -2
- package/dist/session-meta-store.js +57 -7
- package/dist/setup.js +9 -4
- package/dist/skills-catalog.js +8 -4
- package/dist/update.d.ts +11 -2
- package/dist/update.js +0 -27
- package/package.json +18 -10
package/dist/index-daemon.js
CHANGED
|
@@ -3,16 +3,39 @@
|
|
|
3
3
|
* The resident daemon entry — this is what pm2 keeps alive.
|
|
4
4
|
*
|
|
5
5
|
* Boot order matters: install the EPIPE guard first (we're a pm2 child).
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* `@rynx-ai/server` composition root.
|
|
6
|
+
* The composition root reads static plugin manifests, projects chat instances
|
|
7
|
+
* onto remote runner handles, and supervises non-chat plugin workers. Installed
|
|
8
|
+
* plugin code is loaded only in child processes.
|
|
10
9
|
*/
|
|
11
10
|
import { startRynxDaemonServer } from "./daemon-server.js";
|
|
12
11
|
import { installStdioEpipeGuard } from "./stdio-epipe-guard.js";
|
|
13
12
|
installStdioEpipeGuard();
|
|
14
13
|
async function main() {
|
|
15
|
-
await startRynxDaemonServer();
|
|
14
|
+
const server = await startRynxDaemonServer();
|
|
15
|
+
let shutdownPromise;
|
|
16
|
+
const shutdown = (signal) => {
|
|
17
|
+
if (shutdownPromise)
|
|
18
|
+
return shutdownPromise;
|
|
19
|
+
process.off("SIGINT", onSigint);
|
|
20
|
+
process.off("SIGTERM", onSigterm);
|
|
21
|
+
shutdownPromise = (async () => {
|
|
22
|
+
console.log(JSON.stringify({ level: "info", type: "shutdown", signal }));
|
|
23
|
+
await server.shutdown();
|
|
24
|
+
})();
|
|
25
|
+
shutdownPromise.catch((error) => {
|
|
26
|
+
process.exitCode = 1;
|
|
27
|
+
console.error(`Shutdown failed: ${error instanceof Error ? (error.stack ?? error.message) : String(error)}`);
|
|
28
|
+
});
|
|
29
|
+
return shutdownPromise;
|
|
30
|
+
};
|
|
31
|
+
const onSigint = () => {
|
|
32
|
+
void shutdown("SIGINT");
|
|
33
|
+
};
|
|
34
|
+
const onSigterm = () => {
|
|
35
|
+
void shutdown("SIGTERM");
|
|
36
|
+
};
|
|
37
|
+
process.once("SIGINT", onSigint);
|
|
38
|
+
process.once("SIGTERM", onSigterm);
|
|
16
39
|
}
|
|
17
40
|
main().catch((err) => {
|
|
18
41
|
console.error(`Fatal error: ${err instanceof Error ? (err.stack ?? err.message) : String(err)}`);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type ServerAcceptedProofFields, type ServerHelloProofFields } from "@rynx-ai/protocol/direct-runtime";
|
|
2
|
+
export declare function daemonInstallationIdFile(env?: NodeJS.ProcessEnv): string;
|
|
3
|
+
export declare function daemonInstallationKeyFile(env?: NodeJS.ProcessEnv): string;
|
|
4
|
+
export declare function daemonDirectRuntimeEncryptionKeyFile(env?: NodeJS.ProcessEnv): string;
|
|
5
|
+
export interface DaemonInstallationIdentity {
|
|
6
|
+
installationId: string;
|
|
7
|
+
algorithm: "Ed25519";
|
|
8
|
+
/** SPKI DER, base64url encoded. Safe to expose to isolated plugin runners. */
|
|
9
|
+
publicKey: string;
|
|
10
|
+
sign(pluginId: string, challenge: string): string;
|
|
11
|
+
signDirectRuntimeServerHello(channelBinding: Uint8Array, hello: ServerHelloProofFields): string;
|
|
12
|
+
signDirectRuntimeServerAccepted(channelBinding: Uint8Array, helloHash: Uint8Array, authenticateHash: Uint8Array, accepted: ServerAcceptedProofFields): string;
|
|
13
|
+
}
|
|
14
|
+
export interface DaemonDirectRuntimeEncryptionIdentity {
|
|
15
|
+
algorithm: "X25519";
|
|
16
|
+
/** X25519 SubjectPublicKeyInfo DER encoded as unpadded base64url. */
|
|
17
|
+
publicKey: string;
|
|
18
|
+
/** Derive one 32-byte shared secret without exposing the persistent private key. */
|
|
19
|
+
deriveSharedSecret(peerPublicKey: string): Uint8Array;
|
|
20
|
+
}
|
|
21
|
+
/** Direct hosting requires ownership/mode/no-follow checks for its persistent server key. */
|
|
22
|
+
export declare function isDaemonDirectRuntimeHostingSupported(platform?: NodeJS.Platform): boolean;
|
|
23
|
+
/** Load or atomically create the daemon's persistent Direct Runtime E2EE key. */
|
|
24
|
+
export declare function loadOrCreateDaemonDirectRuntimeEncryptionIdentity(env?: NodeJS.ProcessEnv): Promise<DaemonDirectRuntimeEncryptionIdentity>;
|
|
25
|
+
/** Load the stable installation id and proof key without exposing private key material. */
|
|
26
|
+
export declare function loadOrCreateDaemonInstallationIdentity(env?: NodeJS.ProcessEnv): Promise<DaemonInstallationIdentity>;
|
|
27
|
+
/** Synchronous composition-root variant used before spawning an explicit plugin CLI. */
|
|
28
|
+
export declare function loadOrCreateDaemonInstallationIdentitySync(env?: NodeJS.ProcessEnv): DaemonInstallationIdentity;
|
|
29
|
+
/** Load the public ID, creating the proof key first on a new installation. */
|
|
30
|
+
export declare function loadOrCreateDaemonInstallationId(env?: NodeJS.ProcessEnv): Promise<string>;
|
|
31
|
+
/** Synchronous variant for CLI dispatch, which must pin the plugin before yielding. */
|
|
32
|
+
export declare function loadOrCreateDaemonInstallationIdSync(env?: NodeJS.ProcessEnv): string;
|
|
33
|
+
export declare function installationProofPayload(installationId: string, pluginId: string, challenge: string): Buffer;
|