@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
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type PluginInstallRestartResult = "restarted" | "declined" | "not-running";
|
|
2
|
+
export interface PluginInstallRestartOptions {
|
|
3
|
+
restart: boolean;
|
|
4
|
+
interactive: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface PluginInstallRestartDeps {
|
|
7
|
+
isDaemonOnline(): boolean;
|
|
8
|
+
confirmRestart(): Promise<boolean>;
|
|
9
|
+
restartDaemon(): number;
|
|
10
|
+
log(message: string): void;
|
|
11
|
+
}
|
|
12
|
+
/** Apply an installed plugin immediately without unexpectedly starting a stopped daemon. */
|
|
13
|
+
export declare function restartAfterPluginInstall(options: PluginInstallRestartOptions, deps: PluginInstallRestartDeps): Promise<PluginInstallRestartResult>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Apply an installed plugin immediately without unexpectedly starting a stopped daemon. */
|
|
2
|
+
export async function restartAfterPluginInstall(options, deps) {
|
|
3
|
+
if (!options.interactive && !options.restart) {
|
|
4
|
+
deps.log("Rynx was not restarted in non-interactive mode. Pass `--restart` to apply the plugin immediately.");
|
|
5
|
+
return "declined";
|
|
6
|
+
}
|
|
7
|
+
if (!deps.isDaemonOnline()) {
|
|
8
|
+
deps.log("Rynx is not running under PM2; the plugin will load when its owning service next starts or restarts.");
|
|
9
|
+
return "not-running";
|
|
10
|
+
}
|
|
11
|
+
const shouldRestart = options.restart
|
|
12
|
+
? true
|
|
13
|
+
: options.interactive
|
|
14
|
+
? await deps.confirmRestart()
|
|
15
|
+
: false;
|
|
16
|
+
if (!shouldRestart) {
|
|
17
|
+
deps.log("Rynx restart skipped. Run `rynx restart` when you are ready to apply the plugin.");
|
|
18
|
+
return "declined";
|
|
19
|
+
}
|
|
20
|
+
if (deps.restartDaemon() !== 0) {
|
|
21
|
+
throw new Error("Plugin installed, but Rynx failed to restart. Run `rynx restart` manually.");
|
|
22
|
+
}
|
|
23
|
+
return "restarted";
|
|
24
|
+
}
|
|
@@ -1,27 +1,48 @@
|
|
|
1
|
+
import { type PluginCapability, type PluginManifestV1 } from "@rynx-ai/plugin-sdk";
|
|
1
2
|
import { type PluginRecord, type PluginSource } from "./plugin-store.js";
|
|
3
|
+
import { type PluginPackageMaterializer } from "./plugin-package.js";
|
|
2
4
|
export interface InstallResult {
|
|
3
5
|
name: string;
|
|
4
6
|
source: PluginSource;
|
|
5
7
|
version?: string;
|
|
6
|
-
/** True when an existing same-named plugin was kept
|
|
8
|
+
/** True when an existing same-named plugin was kept. */
|
|
7
9
|
skipped?: boolean;
|
|
8
10
|
}
|
|
11
|
+
export interface InstallPluginOptions {
|
|
12
|
+
signal?: AbortSignal;
|
|
13
|
+
onConflict?: (existing: PluginRecord) => boolean | Promise<boolean>;
|
|
14
|
+
/** Pre-approved subset for non-interactive/programmatic callers. */
|
|
15
|
+
grants?: readonly PluginCapability[];
|
|
16
|
+
/** Resolve the approved subset after static inspection and before promotion. */
|
|
17
|
+
approveCapabilities?: (manifest: PluginManifestV1, existing: PluginRecord | undefined) => readonly PluginCapability[] | Promise<readonly PluginCapability[]>;
|
|
18
|
+
/** Dependency injection for offline tests and alternate package fetchers. */
|
|
19
|
+
materializer?: PluginPackageMaterializer;
|
|
20
|
+
/** Require the inspected manifest to retain this id (used by update). */
|
|
21
|
+
expectedId?: string;
|
|
22
|
+
/** Explicitly allow package/dependency lifecycle build scripts in staging. */
|
|
23
|
+
allowScripts?: boolean;
|
|
24
|
+
}
|
|
9
25
|
/**
|
|
10
|
-
* Install
|
|
11
|
-
* - **local**: copy the package (minus `node_modules`) into `~/.rynx/plugins/<name>`
|
|
12
|
-
* and load it there. The plugin must be self-contained — it bundles its deps at
|
|
13
|
-
* build time (incl. the unpublished workspace `@rynx-ai/core`) and declares a
|
|
14
|
-
* `rynx.plugin` entry; the daemon installs nothing.
|
|
15
|
-
* - **npm**: `npm install` into `~/.rynx/plugins` (deps resolved by npm).
|
|
26
|
+
* Install or replace one arbitrary npm/local/git/URL plugin package.
|
|
16
27
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
|
|
28
|
+
* A failed validation, materialization, atomic move, or registry update leaves
|
|
29
|
+
* the previously registered installation untouched.
|
|
30
|
+
*/
|
|
31
|
+
export declare function installPlugin(spec: string, onProgress?: (line: string) => void, opts?: InstallPluginOptions): Promise<InstallResult>;
|
|
32
|
+
/**
|
|
33
|
+
* Remove the registry row but retain the immutable package until the next
|
|
34
|
+
* daemon boot. A currently running supervisor may still be executing it.
|
|
20
35
|
*/
|
|
21
|
-
export declare function installPlugin(spec: string, onProgress?: (line: string) => void, opts?: {
|
|
22
|
-
signal?: AbortSignal;
|
|
23
|
-
onConflict?: (existing: PluginRecord) => boolean | Promise<boolean>;
|
|
24
|
-
}): Promise<InstallResult>;
|
|
25
|
-
/** Uninstall a plugin: drop its record, npm-uninstall if applicable, refresh catalog. */
|
|
26
36
|
export declare function uninstallPlugin(name: string, onProgress?: (line: string) => void): Promise<boolean>;
|
|
37
|
+
/**
|
|
38
|
+
* Delete inactive immutable versions at a daemon-start safe point.
|
|
39
|
+
*
|
|
40
|
+
* A short grace window prevents a concurrently materializing install (renamed
|
|
41
|
+
* just before its registry transaction) from being mistaken for an orphan.
|
|
42
|
+
*/
|
|
43
|
+
export declare function pruneInactivePluginInstallations({ minAgeMs, stagingMinAgeMs, now, }?: {
|
|
44
|
+
minAgeMs?: number;
|
|
45
|
+
stagingMinAgeMs?: number;
|
|
46
|
+
now?: number;
|
|
47
|
+
}): string[];
|
|
27
48
|
export type { PluginRecord };
|