@parall/parall 1.26.0 → 1.26.1
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/package.json +3 -3
- package/src/fork.ts +6 -4
- package/src/gateway.ts +14 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parall/parall",
|
|
3
|
-
"version": "1.26.
|
|
3
|
+
"version": "1.26.1",
|
|
4
4
|
"description": "OpenClaw channel plugin for Parall IM",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"openclaw.plugin.json"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@parall/
|
|
19
|
-
"@parall/
|
|
18
|
+
"@parall/sdk": "1.26.1",
|
|
19
|
+
"@parall/agent-core": "1.26.1"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/node": "^22.0.0",
|
package/src/fork.ts
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
//
|
|
3
3
|
// When the orchestrator's main session is busy, new events are handled by
|
|
4
4
|
// forking the main session's transcript and dispatching to the fork in parallel.
|
|
5
|
-
// The
|
|
6
|
-
//
|
|
7
|
-
//
|
|
5
|
+
// The caller provides a pre-dispatch branch point so the fork inherits
|
|
6
|
+
// history up to (but not including) the in-flight dispatch. Without a
|
|
7
|
+
// branch point, the fork falls back to the current on-disk leaf — which
|
|
8
|
+
// may include partial in-flight state.
|
|
8
9
|
|
|
9
10
|
import * as fs from "node:fs";
|
|
10
11
|
import * as path from "node:path";
|
|
@@ -102,6 +103,7 @@ export function forkOrchestratorSession(opts: {
|
|
|
102
103
|
accountId: string;
|
|
103
104
|
transcriptFile: string;
|
|
104
105
|
sessionsDir: string;
|
|
106
|
+
branchPointId?: string;
|
|
105
107
|
}): ForkSessionResult | null {
|
|
106
108
|
const { orchestratorSessionKey, accountId, transcriptFile, sessionsDir } = opts;
|
|
107
109
|
|
|
@@ -109,7 +111,7 @@ export function forkOrchestratorSession(opts: {
|
|
|
109
111
|
|
|
110
112
|
try {
|
|
111
113
|
const manager = SessionManager.open(transcriptFile);
|
|
112
|
-
const leafId = manager.getLeafId();
|
|
114
|
+
const leafId = opts.branchPointId ?? manager.getLeafId();
|
|
113
115
|
|
|
114
116
|
let sessionId: string;
|
|
115
117
|
let sessionFile: string;
|
package/src/gateway.ts
CHANGED
|
@@ -27,6 +27,7 @@ import { buildOrchestratorSessionKey } from "./session.js";
|
|
|
27
27
|
import type { ResolvedParallAccount } from "./types.js";
|
|
28
28
|
import { fetchAndApplyPlatformConfig } from "./config-manager.js";
|
|
29
29
|
import { startWikiHelper } from "./wiki-helper.js";
|
|
30
|
+
import { SessionManager } from "@mariozechner/pi-coding-agent";
|
|
30
31
|
import { cleanupForkSession, forkOrchestratorSession, resolveTranscriptFile } from "./fork.js";
|
|
31
32
|
|
|
32
33
|
function resolveWsUrl(account: ResolvedParallAccount): string {
|
|
@@ -210,7 +211,18 @@ function createOpenClawDispatchAdapter(opts: {
|
|
|
210
211
|
yield* stream.stream();
|
|
211
212
|
},
|
|
212
213
|
|
|
213
|
-
|
|
214
|
+
getBranchPoint(sessionKey: string): string | undefined {
|
|
215
|
+
const transcriptFile = resolveTranscriptFile(opts.sessionsDir, sessionKey);
|
|
216
|
+
if (!transcriptFile) return undefined;
|
|
217
|
+
try {
|
|
218
|
+
const manager = SessionManager.open(transcriptFile);
|
|
219
|
+
return manager.getLeafId() ?? undefined;
|
|
220
|
+
} catch {
|
|
221
|
+
return undefined;
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
|
|
225
|
+
forkSession({ sessionKey, preDispatchBranchPoint }) {
|
|
214
226
|
const transcriptFile = resolveTranscriptFile(opts.sessionsDir, sessionKey);
|
|
215
227
|
if (!transcriptFile) return null;
|
|
216
228
|
return forkOrchestratorSession({
|
|
@@ -218,6 +230,7 @@ function createOpenClawDispatchAdapter(opts: {
|
|
|
218
230
|
accountId: opts.accountId,
|
|
219
231
|
transcriptFile,
|
|
220
232
|
sessionsDir: opts.sessionsDir,
|
|
233
|
+
branchPointId: preDispatchBranchPoint,
|
|
221
234
|
});
|
|
222
235
|
},
|
|
223
236
|
|