@loggie-ai/openclaw-plugin 0.1.2 → 0.1.3
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.
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { join } from "node:path";
|
|
1
|
+
import { dirname, join } from "node:path";
|
|
2
|
+
import { getSessionEntry, resolveAndPersistSessionFile, } from "openclaw/plugin-sdk/session-store-runtime";
|
|
2
3
|
import { fetchLoggieTranscriptDetail } from "../loggie-client.js";
|
|
3
4
|
import { buildLoggieRouteSessionKey, buildLoggieSessionId, meetingConversationId } from "../routing.js";
|
|
4
5
|
import { formatTranscriptReadyPrompt } from "./transcript-format.js";
|
|
@@ -97,12 +98,26 @@ export function createOpenClawTranscriptDispatcher(params) {
|
|
|
97
98
|
const agentRuntime = await getAgentRuntime();
|
|
98
99
|
const workspaceDir = agentRuntime.resolveAgentWorkspaceDir(params.cfg, params.account.agentId);
|
|
99
100
|
const agentDir = agentRuntime.resolveAgentDir(params.cfg, params.account.agentId);
|
|
100
|
-
const
|
|
101
|
+
const fallbackSessionFile = join(agentDir, "sessions", `${sessionId}.jsonl`);
|
|
102
|
+
const resolved = await getSessionEntry({
|
|
103
|
+
storePath,
|
|
104
|
+
sessionKey: routeSessionKey,
|
|
105
|
+
});
|
|
106
|
+
const canonicalSessionKey = resolved.normalizedKey;
|
|
107
|
+
const { sessionFile } = await resolveAndPersistSessionFile({
|
|
108
|
+
sessionId,
|
|
109
|
+
sessionKey: canonicalSessionKey,
|
|
110
|
+
storePath,
|
|
111
|
+
sessionEntry: resolved.entry,
|
|
112
|
+
agentId: params.account.agentId,
|
|
113
|
+
sessionsDir: dirname(storePath),
|
|
114
|
+
fallbackSessionFile,
|
|
115
|
+
});
|
|
101
116
|
await agentRuntime.ensureAgentWorkspace?.({ dir: workspaceDir });
|
|
102
117
|
return agentRuntime.runEmbeddedAgent({
|
|
103
118
|
sessionId,
|
|
104
119
|
sessionFile,
|
|
105
|
-
sessionKey:
|
|
120
|
+
sessionKey: canonicalSessionKey,
|
|
106
121
|
agentId: params.account.agentId,
|
|
107
122
|
messageChannel: "loggie",
|
|
108
123
|
messageProvider: "loggie",
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { join } from "node:path";
|
|
1
|
+
import { dirname, join } from "node:path";
|
|
2
2
|
import type { OpenClawConfig, PluginRuntime } from "openclaw/plugin-sdk/channel-core";
|
|
3
|
+
import {
|
|
4
|
+
getSessionEntry,
|
|
5
|
+
resolveAndPersistSessionFile,
|
|
6
|
+
} from "openclaw/plugin-sdk/session-store-runtime";
|
|
3
7
|
import type { ResolvedLoggieAccount } from "../account.js";
|
|
4
8
|
import type { LoggieTranscriptReadyEvent } from "../event-types.js";
|
|
5
9
|
import { fetchLoggieTranscriptDetail } from "../loggie-client.js";
|
|
@@ -139,12 +143,26 @@ export function createOpenClawTranscriptDispatcher(params: {
|
|
|
139
143
|
params.account.agentId,
|
|
140
144
|
);
|
|
141
145
|
const agentDir = agentRuntime.resolveAgentDir(params.cfg, params.account.agentId);
|
|
142
|
-
const
|
|
146
|
+
const fallbackSessionFile = join(agentDir, "sessions", `${sessionId}.jsonl`);
|
|
147
|
+
const resolved = await getSessionEntry({
|
|
148
|
+
storePath,
|
|
149
|
+
sessionKey: routeSessionKey,
|
|
150
|
+
});
|
|
151
|
+
const canonicalSessionKey = resolved.normalizedKey;
|
|
152
|
+
const { sessionFile } = await resolveAndPersistSessionFile({
|
|
153
|
+
sessionId,
|
|
154
|
+
sessionKey: canonicalSessionKey,
|
|
155
|
+
storePath,
|
|
156
|
+
sessionEntry: resolved.entry,
|
|
157
|
+
agentId: params.account.agentId,
|
|
158
|
+
sessionsDir: dirname(storePath),
|
|
159
|
+
fallbackSessionFile,
|
|
160
|
+
});
|
|
143
161
|
await agentRuntime.ensureAgentWorkspace?.({ dir: workspaceDir });
|
|
144
162
|
return agentRuntime.runEmbeddedAgent({
|
|
145
163
|
sessionId,
|
|
146
164
|
sessionFile,
|
|
147
|
-
sessionKey:
|
|
165
|
+
sessionKey: canonicalSessionKey,
|
|
148
166
|
agentId: params.account.agentId,
|
|
149
167
|
messageChannel: "loggie",
|
|
150
168
|
messageProvider: "loggie",
|