@rynx-ai/daemon 0.1.11-beta.4 → 0.1.11-beta.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.
Files changed (72) hide show
  1. package/bundled-plugins/plugins/lark/.rynx-plugin/plugin.json +0 -12
  2. package/bundled-plugins/plugins/lark/dist/cli-mirror/mirror-index.js +3 -1
  3. package/bundled-plugins/plugins/lark/dist/host-adapters.d.ts +3 -3
  4. package/bundled-plugins/plugins/lark/dist/host-adapters.js +24 -18
  5. package/bundled-plugins/plugins/lark/dist/lark.js +18 -12
  6. package/bundled-plugins/plugins/lark/dist/runtime.js +6043 -6016
  7. package/bundled-plugins/plugins/lark/dist/settings.js +6003 -5985
  8. package/bundled-plugins/plugins/lark/package.json +1 -1
  9. package/bundled-plugins/plugins/lark/ui/assets/index-CGUVAMsv.css +1 -0
  10. package/bundled-plugins/plugins/lark/ui/index.html +2 -2
  11. package/dist/agent-file.js +0 -1
  12. package/dist/browser-artifact-management.js +4 -1
  13. package/dist/chrome-for-testing-http.d.ts +9 -0
  14. package/dist/chrome-for-testing-http.js +58 -0
  15. package/dist/chrome-for-testing-release-resolver.js +13 -6
  16. package/dist/chrome-for-testing-runtime.js +4 -3
  17. package/dist/chrome-for-testing-store.d.ts +2 -0
  18. package/dist/chrome-for-testing-store.js +99 -17
  19. package/dist/control-deps.d.ts +6 -2
  20. package/dist/control-deps.js +87 -4
  21. package/dist/control-link-store.js +4 -3
  22. package/dist/daemon-owner.js +4 -7
  23. package/dist/daemon-server.js +42 -17
  24. package/dist/db.d.ts +2 -2
  25. package/dist/db.js +157 -21
  26. package/dist/headless-browser-host.js +397 -41
  27. package/dist/lifecycle.d.ts +2 -1
  28. package/dist/lifecycle.js +4 -1
  29. package/dist/migrations/cleanup-legacy-sessions.js +4 -3
  30. package/dist/plugin-cli.d.ts +10 -0
  31. package/dist/plugin-cli.js +19 -2
  32. package/dist/plugin-host-rpc.d.ts +48 -9
  33. package/dist/plugin-host-rpc.js +593 -81
  34. package/dist/plugin-installer.js +3 -2
  35. package/dist/plugin-management-service.js +0 -2
  36. package/dist/plugin-marketplace.js +2 -1
  37. package/dist/plugin-store.js +2 -4
  38. package/dist/plugin-supervisor.js +0 -4
  39. package/dist/pm2.d.ts +2 -0
  40. package/dist/pm2.js +6 -0
  41. package/dist/remote-runtime-access-store.d.ts +2 -2
  42. package/dist/remote-runtime-access-store.js +6 -9
  43. package/dist/remote-runtime-connection-manager.js +25 -42
  44. package/dist/remote-runtime-target-store.d.ts +2 -2
  45. package/dist/remote-runtime-target-store.js +6 -6
  46. package/dist/session-emulator-binding-store.js +4 -6
  47. package/dist/session-fork-store.d.ts +1 -0
  48. package/dist/session-fork-store.js +85 -30
  49. package/dist/session-launch-operations.js +6 -5
  50. package/dist/session-log-store.d.ts +1 -0
  51. package/dist/session-log-store.js +46 -22
  52. package/dist/session-meta-store.d.ts +5 -0
  53. package/dist/session-meta-store.js +25 -2
  54. package/dist/session-portal-grant-store.d.ts +55 -0
  55. package/dist/session-portal-grant-store.js +160 -0
  56. package/dist/session-resource-store.d.ts +24 -6
  57. package/dist/session-resource-store.js +387 -69
  58. package/dist/session-timeline-projection-store.d.ts +24 -0
  59. package/dist/session-timeline-projection-store.js +53 -0
  60. package/dist/setup-service.d.ts +1 -0
  61. package/dist/setup-service.js +1 -0
  62. package/dist/skills-catalog.d.ts +11 -2
  63. package/dist/skills-catalog.js +317 -10
  64. package/dist/sqlite.d.ts +22 -0
  65. package/dist/sqlite.js +57 -0
  66. package/dist/stdio-epipe-guard.d.ts +1 -1
  67. package/dist/stdio-epipe-guard.js +1 -1
  68. package/dist/system-dependencies.d.ts +22 -0
  69. package/dist/system-dependencies.js +79 -0
  70. package/package.json +17 -12
  71. package/bundled-plugins/plugins/lark/ui/assets/index-B2dhMlMU.css +0 -1
  72. /package/bundled-plugins/plugins/lark/ui/assets/{index-D9N-AkLX.js → index-D8Amoe6a.js} +0 -0
@@ -20,6 +20,7 @@ import { mkdirSync, readFileSync, renameSync, writeFileSync, } from "node:fs";
20
20
  import path from "node:path";
21
21
  import { rynxHome } from "@rynx-ai/core";
22
22
  import { db } from "../db.js";
23
+ import { transaction } from "../sqlite.js";
23
24
  /** Mirrors the daemon runtime store's default resolution. */
24
25
  function defaultProxyDir() {
25
26
  return path.join(rynxHome(), ".codex-proxy");
@@ -46,9 +47,9 @@ export function cleanupLegacySessions(opts = {}) {
46
47
  let deletedLogRows = 0;
47
48
  let deletedSessions = 0;
48
49
  let prunedStoreEntries = 0;
49
- conn.transaction(() => {
50
- deletedLogRows = conn.prepare(`DELETE FROM session_items WHERE ${LEGACY_LOG}`).run().changes;
51
- deletedSessions = conn.prepare(`DELETE FROM sessions WHERE ${LEGACY_META}`).run().changes;
50
+ transaction(conn, () => {
51
+ deletedLogRows = Number(conn.prepare(`DELETE FROM session_items WHERE ${LEGACY_LOG}`).run().changes);
52
+ deletedSessions = Number(conn.prepare(`DELETE FROM sessions WHERE ${LEGACY_META}`).run().changes);
52
53
  })();
53
54
  // The runtime store is daemon-owned. Plugin routing stores remain private to
54
55
  // their plugins and are never inspected by this migration.
@@ -20,6 +20,16 @@ export interface PluginCliCommandResult {
20
20
  stderrTruncated: boolean;
21
21
  };
22
22
  }
23
+ export interface InstalledPluginListItem {
24
+ id: string;
25
+ version: string;
26
+ source: "local" | "git";
27
+ state: "enabled" | "disabled";
28
+ }
29
+ /** Read the durable installed-plugin inventory without contacting the daemon. */
30
+ export declare function listInstalledPlugins(): InstalledPluginListItem[];
31
+ /** Render manifest-declared command help without executing plugin code. */
32
+ export declare function installedPluginCommandUsage(pluginId: string): string;
23
33
  /** Execute one statically declared, language-neutral plugin command. */
24
34
  export declare function runPluginCliCommand(pluginId: string, args: readonly string[], options?: RunPluginCliOptions): Promise<PluginCliCommandResult>;
25
35
  export declare function pluginCommandUsage(record: RunnablePluginRecord): string;
@@ -3,12 +3,29 @@ import { mkdirSync, realpathSync, statSync } from "node:fs";
3
3
  import path from "node:path";
4
4
  import { createPluginCliInvocationLeaseId, removePluginRuntimeLease, writePluginRuntimeLease, } from "@rynx-ai/plugin-sdk";
5
5
  import { db } from "./db.js";
6
+ import { transaction } from "./sqlite.js";
6
7
  import { pluginDataDir, pluginRuntimeCacheDir } from "./plugin-installer.js";
7
8
  import { validatePluginPackageSnapshot } from "./plugin-package.js";
8
- import { getPlugin } from "./plugin-store.js";
9
+ import { getPlugin, listPlugins, } from "./plugin-store.js";
9
10
  import { loadOrCreateDaemonInstallationIdentitySync } from "./installation-id.js";
10
11
  const DEFAULT_TERMINATION_GRACE_MS = 2_000;
11
12
  const MAX_TERMINATION_GRACE_MS = 30_000;
13
+ /** Read the durable installed-plugin inventory without contacting the daemon. */
14
+ export function listInstalledPlugins() {
15
+ return listPlugins().map((record) => ({
16
+ id: record.canonicalId,
17
+ version: record.version,
18
+ source: record.source,
19
+ state: record.enabled ? "enabled" : "disabled",
20
+ }));
21
+ }
22
+ /** Render manifest-declared command help without executing plugin code. */
23
+ export function installedPluginCommandUsage(pluginId) {
24
+ const record = getPlugin(pluginId);
25
+ if (!record)
26
+ throw new Error(`plugin "${pluginId}" is not installed`);
27
+ return pluginCommandUsage(record);
28
+ }
12
29
  /** Execute one statically declared, language-neutral plugin command. */
13
30
  export async function runPluginCliCommand(pluginId, args, options = {}) {
14
31
  const hostEnv = options.env ?? process.env;
@@ -74,7 +91,7 @@ export async function runPluginCliCommand(pluginId, args, options = {}) {
74
91
  removePluginRuntimeLease(dataDir, leaseId);
75
92
  };
76
93
  try {
77
- db().transaction(() => {
94
+ transaction(db(), () => {
78
95
  const record = getPlugin(pluginId);
79
96
  if (!record)
80
97
  throw new Error(`plugin "${pluginId}" is not installed`);
@@ -1,6 +1,8 @@
1
- import { type AdmissionReservation, type AgentSpec, type AgentCapabilities, type AgentRuntimeId, type AgentSessionStore, type ConversationRuntime, type ResolvedExecutionSnapshot, type SessionRegistry, type SessionWorkspaceSnapshot } from "@rynx-ai/core";
2
- import { type PluginAgentSummary, type PluginCapability, type PluginHostEvent, type PluginResolvedSessionExecution, type PluginSessionExecutionSnapshot, type PluginSessionInteractionResolveDisposition } from "@rynx-ai/plugin-sdk";
1
+ import { type AdmissionReservation, type AgentSpec, type AgentCapabilities, type AgentRuntimeId, type AgentSessionStore, type ResolvedExecutionSnapshot, type RuntimeCollaborationMode, type SessionRegistry, type SessionWorkspaceSnapshot, type SteerSignal } from "@rynx-ai/core";
2
+ import { type PluginAgentSummary, type PluginHostEvent, type PluginSessionActivitySnapshot, type PluginResolvedSessionExecution, type PluginSessionExecutionSnapshot, type PluginSessionInteractionResolveDisposition } from "@rynx-ai/plugin-sdk";
3
3
  import type { SessionInteractionResolution } from "@rynx-ai/protocol";
4
+ import { type RuntimeBrowserRequestHeadersGetParams, type RuntimeBrowserRequestHeadersPolicy, type RuntimeBrowserRequestHeadersSetParams } from "@rynx-ai/protocol/runtime-browser";
5
+ import { type MachineSessionMessageInput, type StartedMachineSessionRun } from "@rynx-ai/server";
4
6
  import { PluginRunnerError } from "@rynx-ai/plugin-runner";
5
7
  /** Leaves ample room for the RPC envelope below the runner's 1 MiB line cap. */
6
8
  export declare const MAX_PLUGIN_HOST_EVENT_BYTES: number;
@@ -22,7 +24,7 @@ export interface PluginSessionLaunchSelection {
22
24
  agent?: string;
23
25
  config?: AgentSpec;
24
26
  provider?: AgentRuntimeId;
25
- model?: string;
27
+ model?: string | null;
26
28
  reasoningEffort?: string;
27
29
  title?: string;
28
30
  }
@@ -37,7 +39,20 @@ export interface PluginHostServices {
37
39
  publicKey: string;
38
40
  sign(pluginId: string, challenge: string): string;
39
41
  };
40
- conversationRuntime: ConversationRuntime;
42
+ sessionRuns: {
43
+ startRun: (sessionId: string, input: string | MachineSessionMessageInput, options?: {
44
+ signal?: AbortSignal;
45
+ steer?: SteerSignal;
46
+ collaborationMode?: RuntimeCollaborationMode;
47
+ }) => Promise<StartedMachineSessionRun>;
48
+ };
49
+ sessionFiles: {
50
+ resolveResourcePath(sessionId: string, resourceId: string): Promise<string>;
51
+ };
52
+ sessionBrowserRequestHeaders?: {
53
+ getRequestHeaders(input: RuntimeBrowserRequestHeadersGetParams): Promise<RuntimeBrowserRequestHeadersPolicy>;
54
+ setRequestHeaders(input: RuntimeBrowserRequestHeadersSetParams): Promise<RuntimeBrowserRequestHeadersPolicy>;
55
+ };
41
56
  capabilities: AgentCapabilities;
42
57
  sessionStore: AgentSessionStore;
43
58
  sessionRegistry: SessionRegistry;
@@ -45,8 +60,25 @@ export interface PluginHostServices {
45
60
  sessionLaunch: {
46
61
  resolve(input: PluginSessionLaunchSelection): Promise<PluginResolvedSessionLaunch>;
47
62
  };
63
+ sessionExecution: {
64
+ update(input: {
65
+ sessionId: string;
66
+ model: string | null;
67
+ reasoningEffort: string | null;
68
+ }): Promise<void>;
69
+ };
70
+ sessionActivity(sessionId: string): PluginSessionActivitySnapshot | Promise<PluginSessionActivitySnapshot>;
48
71
  interruptSession?(sessionId: string): Promise<boolean>;
49
72
  terminateSession?(sessionId: string): Promise<boolean>;
73
+ sessionTimeline?: {
74
+ hasItem(sessionId: string, itemId: string): Promise<boolean>;
75
+ projectText(input: {
76
+ sessionId: string;
77
+ responseId: string;
78
+ itemId: string;
79
+ text: string;
80
+ }): Promise<void>;
81
+ };
50
82
  resolveSessionInteraction?(sessionId: string, interactionId: string, resolution: SessionInteractionResolution): Promise<{
51
83
  disposition: PluginSessionInteractionResolveDisposition;
52
84
  }>;
@@ -60,6 +92,11 @@ export interface PluginHostServices {
60
92
  }>;
61
93
  admissionOpen?: () => boolean;
62
94
  admissionReserve?: () => AdmissionReservation | undefined;
95
+ sessionPortal?: {
96
+ scheme: "http" | "https";
97
+ bindHost: string;
98
+ port: number;
99
+ };
63
100
  }
64
101
  export interface PluginHostRpcOptions {
65
102
  /** Manifest id returned by host.info. */
@@ -69,7 +106,6 @@ export interface PluginHostRpcOptions {
69
106
  daemonInstanceId: string;
70
107
  productVersion: string;
71
108
  cliVersion: string;
72
- capabilities: readonly PluginCapability[];
73
109
  services: PluginHostServices;
74
110
  /** Canonical plugin-owned root permitted for the Workspace plugin's isolated
75
111
  * Session directory. Omitted for every other plugin. */
@@ -80,7 +116,7 @@ export interface PluginHostRpcOptions {
80
116
  disposeForceAfterMs?: number;
81
117
  }
82
118
  /**
83
- * One authenticated plugin's capability-gated Host RPC surface.
119
+ * One authenticated plugin's Host RPC surface.
84
120
  *
85
121
  * This adapter is deliberately the only place that maps public string methods
86
122
  * to trusted runtime objects. The runner receives neither this class nor its
@@ -92,7 +128,6 @@ export declare class PluginHostRpc {
92
128
  private readonly daemonInstanceId;
93
129
  private readonly productVersion;
94
130
  private readonly cliVersion;
95
- private readonly capabilities;
96
131
  private readonly services;
97
132
  private readonly managedWorkspaceRoot;
98
133
  private readonly emit;
@@ -113,11 +148,11 @@ export declare class PluginHostRpc {
113
148
  private runSession;
114
149
  private runSessionAdmitted;
115
150
  private pumpRun;
151
+ private projectSessionFileEvent;
116
152
  private releaseRun;
117
- private steerSession;
118
153
  private interruptRun;
154
+ private sessionActivity;
119
155
  private interruptWon;
120
- private activeRun;
121
156
  private activeRunByIdentity;
122
157
  private getBinding;
123
158
  private listBindings;
@@ -129,8 +164,12 @@ export declare class PluginHostRpc {
129
164
  private reserveAdmission;
130
165
  private withAdmission;
131
166
  private setSessionTitle;
167
+ private getSessionBrowserRequestHeaders;
168
+ private setSessionBrowserRequestHeaders;
132
169
  private resolveAgentExecution;
133
170
  private issueControlLink;
171
+ private issueSessionPortalLink;
172
+ private projectTimelineText;
134
173
  private ownedSession;
135
174
  private isOwned;
136
175
  }