@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.
Files changed (89) hide show
  1. package/dist/browser-cli-args.d.ts +20 -0
  2. package/dist/browser-cli-args.js +100 -0
  3. package/dist/browser-runner-session-context.d.ts +24 -0
  4. package/dist/browser-runner-session-context.js +113 -0
  5. package/dist/cdp-keyboard-input.d.ts +6 -0
  6. package/dist/cdp-keyboard-input.js +209 -0
  7. package/dist/channel-store.d.ts +0 -6
  8. package/dist/channel-store.js +2 -18
  9. package/dist/chrome-for-testing-release-resolver.d.ts +34 -0
  10. package/dist/chrome-for-testing-release-resolver.js +214 -0
  11. package/dist/chrome-for-testing-store.d.ts +85 -0
  12. package/dist/chrome-for-testing-store.js +836 -0
  13. package/dist/cli.js +467 -30
  14. package/dist/control-client.d.ts +113 -0
  15. package/dist/control-client.js +792 -0
  16. package/dist/control-deps.js +37 -6
  17. package/dist/control-endpoint.d.ts +14 -0
  18. package/dist/control-endpoint.js +124 -0
  19. package/dist/control-link-store.d.ts +16 -0
  20. package/dist/control-link-store.js +53 -0
  21. package/dist/daemon-owner.d.ts +14 -0
  22. package/dist/daemon-owner.js +104 -0
  23. package/dist/daemon-server.d.ts +12 -2
  24. package/dist/daemon-server.js +559 -28
  25. package/dist/db.js +140 -10
  26. package/dist/desktop-browser-host-client.d.ts +34 -0
  27. package/dist/desktop-browser-host-client.js +413 -0
  28. package/dist/direct-runtime-authenticator.d.ts +13 -0
  29. package/dist/direct-runtime-authenticator.js +127 -0
  30. package/dist/direct-runtime-config.d.ts +20 -0
  31. package/dist/direct-runtime-config.js +101 -0
  32. package/dist/embedded-browser-profile-cleanup.d.ts +58 -0
  33. package/dist/embedded-browser-profile-cleanup.js +338 -0
  34. package/dist/headless-browser-host.d.ts +14 -0
  35. package/dist/headless-browser-host.js +2156 -0
  36. package/dist/index-daemon.js +28 -5
  37. package/dist/installation-id.d.ts +33 -0
  38. package/dist/installation-id.js +692 -0
  39. package/dist/migrations/cleanup-legacy-sessions.d.ts +0 -3
  40. package/dist/migrations/cleanup-legacy-sessions.js +10 -28
  41. package/dist/plugin-cli.d.ts +30 -0
  42. package/dist/plugin-cli.js +270 -0
  43. package/dist/plugin-host-rpc.d.ts +85 -0
  44. package/dist/plugin-host-rpc.js +878 -0
  45. package/dist/plugin-install-restart.d.ts +13 -0
  46. package/dist/plugin-install-restart.js +24 -0
  47. package/dist/plugin-installer.d.ts +36 -15
  48. package/dist/plugin-installer.js +420 -155
  49. package/dist/plugin-package.d.ts +38 -0
  50. package/dist/plugin-package.js +553 -0
  51. package/dist/plugin-runtime-control.d.ts +2 -0
  52. package/dist/plugin-runtime-control.js +37 -0
  53. package/dist/plugin-store.d.ts +37 -8
  54. package/dist/plugin-store.js +80 -15
  55. package/dist/plugin-supervisor.d.ts +160 -0
  56. package/dist/plugin-supervisor.js +1143 -0
  57. package/dist/pm2.d.ts +3 -1
  58. package/dist/pm2.js +55 -13
  59. package/dist/provider-cli-service.d.ts +46 -0
  60. package/dist/provider-cli-service.js +510 -0
  61. package/dist/registry.d.ts +6 -19
  62. package/dist/registry.js +22 -87
  63. package/dist/remote-runtime-access-store.d.ts +61 -0
  64. package/dist/remote-runtime-access-store.js +386 -0
  65. package/dist/remote-runtime-admin.d.ts +32 -0
  66. package/dist/remote-runtime-admin.js +107 -0
  67. package/dist/remote-runtime-connection-manager.d.ts +92 -0
  68. package/dist/remote-runtime-connection-manager.js +1409 -0
  69. package/dist/remote-runtime-credential-store.d.ts +45 -0
  70. package/dist/remote-runtime-credential-store.js +639 -0
  71. package/dist/remote-runtime-target-control.d.ts +47 -0
  72. package/dist/remote-runtime-target-control.js +433 -0
  73. package/dist/remote-runtime-target-store.d.ts +53 -0
  74. package/dist/remote-runtime-target-store.js +307 -0
  75. package/dist/runtime-share-addresses.d.ts +21 -0
  76. package/dist/runtime-share-addresses.js +50 -0
  77. package/dist/session-browser-capability-store.d.ts +13 -0
  78. package/dist/session-browser-capability-store.js +58 -0
  79. package/dist/session-emulator-binding-store.d.ts +10 -0
  80. package/dist/session-emulator-binding-store.js +61 -0
  81. package/dist/session-launch-operations.d.ts +41 -0
  82. package/dist/session-launch-operations.js +124 -0
  83. package/dist/session-meta-store.d.ts +3 -2
  84. package/dist/session-meta-store.js +57 -7
  85. package/dist/setup.js +9 -4
  86. package/dist/skills-catalog.js +8 -4
  87. package/dist/update.d.ts +11 -2
  88. package/dist/update.js +0 -27
  89. 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 (user declined to overwrite). */
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 (or re-install) a plugin from an npm spec or a local directory.
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
- * `onConflict` is consulted when a plugin of the same `name` already exists; if it
18
- * returns false the install is aborted with `{ skipped: true }` (nothing changes).
19
- * `onProgress` streams human-readable lines.
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 };