@rynx-ai/daemon 0.1.11-beta.45 → 0.1.11-beta.49

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.
@@ -8,6 +8,7 @@ import { SessionBrowserServiceError, } from "@rynx-ai/server";
8
8
  import { PluginRunnerError } from "@rynx-ai/plugin-runner";
9
9
  import { ensurePluginSessionLaunch, replayPluginSessionLaunch, SessionLaunchOperationConflictError, SessionLaunchOperationTargetDeletedError, } from "./session-launch-operations.js";
10
10
  import { createControlLink } from "./control-link-store.js";
11
+ import { nodeLogFiles, sessionLogFiles } from "./log-files.js";
11
12
  import { issueSessionPortalTicket, revokeSessionPortalGrant, } from "./session-portal-grant-store.js";
12
13
  import { claimSessionTimelineProjection, completeSessionTimelineProjection, } from "./session-timeline-projection-store.js";
13
14
  const MAX_MESSAGE_LENGTH = 1_000_000;
@@ -120,6 +121,7 @@ export class PluginHostRpc {
120
121
  },
121
122
  protocolVersion: 1,
122
123
  capabilities: {
124
+ rawLogFiles: true,
123
125
  sessionRunContent: true,
124
126
  sessionRunFiles: true,
125
127
  ...(this.services.sessionTimeline
@@ -142,6 +144,48 @@ export class PluginHostRpc {
142
144
  }
143
145
  try {
144
146
  switch (method) {
147
+ case "node.logFiles.list":
148
+ return await nodeLogFiles();
149
+ case "session.logFiles.list": {
150
+ const sessionId = requiredSessionId(params);
151
+ const session = this.ownedSession(sessionId);
152
+ return await sessionLogFiles(session, await this.services.sessionStore.get(sessionId));
153
+ }
154
+ case "session.logFiles.related": {
155
+ const sessionId = requiredSessionId(params);
156
+ this.ownedSession(sessionId);
157
+ const input = record(params);
158
+ const cursor = input.cursor ?? 0;
159
+ if (typeof cursor !== "number" || !Number.isSafeInteger(cursor) || cursor < 0)
160
+ throw new PluginHostCallError("INVALID_PARAMS", "invalid cursor");
161
+ const owned = this.services.sessionRegistry.list().filter((s) => this.isOwned(s));
162
+ const ids = new Set(owned.map((s) => s.id));
163
+ const bindings = await this.services.sessionStore.listAll();
164
+ const edges = [];
165
+ for (const s of owned)
166
+ if (s.forkedFromSessionId && ids.has(s.forkedFromSessionId))
167
+ edges.push([s.id, s.forkedFromSessionId]);
168
+ for (const b of bindings) {
169
+ const extended = b;
170
+ for (const parent of [b.parentSessionId, extended.nativeRotationSourceSessionId])
171
+ if (parent && ids.has(b.localThreadId) && ids.has(parent))
172
+ edges.push([b.localThreadId, parent]);
173
+ }
174
+ const related = new Set([sessionId]);
175
+ let changed = true;
176
+ while (changed) {
177
+ changed = false;
178
+ for (const [a, b] of edges)
179
+ if (related.has(a) || related.has(b)) {
180
+ if (!related.has(a) || !related.has(b))
181
+ changed = true;
182
+ related.add(a);
183
+ related.add(b);
184
+ }
185
+ }
186
+ const result = [...related].sort();
187
+ return { sessionIds: result.slice(cursor, cursor + 64), ...(cursor + 64 < result.length ? { nextCursor: cursor + 64 } : {}) };
188
+ }
145
189
  case "installation.proof.sign": {
146
190
  const challenge = requiredString(record(params).challenge, "challenge", 16_384);
147
191
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rynx-ai/daemon",
3
- "version": "0.1.11-beta.45",
3
+ "version": "0.1.11-beta.49",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/rynx-ai/rynx.git",
@@ -47,25 +47,26 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "@electron-internal/extract-zip": "1.0.5",
50
+ "agent-browser": "0.36.0",
50
51
  "pm2": "^6.0.0",
51
52
  "tar": "^7.5.19",
52
53
  "undici": "^7.28.0",
53
54
  "ws": "^8.21.0",
54
- "@rynx-ai/emulator": "0.1.11-beta.45",
55
- "@rynx-ai/plugin-runner": "0.1.11-beta.45",
56
- "@rynx-ai/plugin-sdk": "0.1.11-beta.45",
57
- "@rynx-ai/protocol": "0.1.11-beta.45",
58
- "@rynx-ai/remote-runtime-client": "0.1.11-beta.45",
59
- "@rynx-ai/core": "0.1.11-beta.45",
60
- "@rynx-ai/server": "0.1.11-beta.45"
55
+ "@rynx-ai/plugin-sdk": "0.1.11-beta.49",
56
+ "@rynx-ai/plugin-runner": "0.1.11-beta.49",
57
+ "@rynx-ai/core": "0.1.11-beta.49",
58
+ "@rynx-ai/emulator": "0.1.11-beta.49",
59
+ "@rynx-ai/protocol": "0.1.11-beta.49",
60
+ "@rynx-ai/remote-runtime-client": "0.1.11-beta.49",
61
+ "@rynx-ai/server": "0.1.11-beta.49"
61
62
  },
62
63
  "devDependencies": {
63
64
  "@types/ws": "^8.18.1",
64
- "@rynx-ai/plugin-channel-lark": "0.1.11-beta.45",
65
- "@rynx-ai/browser-cdp": "0.1.11-beta.45"
65
+ "@rynx-ai/browser-cdp": "0.1.11-beta.49",
66
+ "@rynx-ai/plugin-channel-lark": "0.1.11-beta.49"
66
67
  },
67
68
  "scripts": {
68
- "build": "rm -rf dist bundled-plugins && tsc -p tsconfig.json && chmod +x dist/index-daemon.js && node ../../scripts/stage-bundled-plugins.mjs",
69
+ "build": "rm -rf dist bundled-plugins && tsc -p tsconfig.json && chmod +x dist/index-daemon.js && node scripts/prepare-agent-browser.mjs && node ../../scripts/stage-bundled-plugins.mjs",
69
70
  "dev": "tsx watch --tsconfig ../../tsconfig.json src/index-daemon.ts"
70
71
  }
71
72
  }