@loggie-ai/openclaw-plugin 0.1.1 → 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,3 +1,5 @@
1
+ import { dirname, join } from "node:path";
2
+ import { getSessionEntry, resolveAndPersistSessionFile, } from "openclaw/plugin-sdk/session-store-runtime";
1
3
  import { fetchLoggieTranscriptDetail } from "../loggie-client.js";
2
4
  import { buildLoggieRouteSessionKey, buildLoggieSessionId, meetingConversationId } from "../routing.js";
3
5
  import { formatTranscriptReadyPrompt } from "./transcript-format.js";
@@ -95,10 +97,27 @@ export function createOpenClawTranscriptDispatcher(params) {
95
97
  runDispatch: async () => {
96
98
  const agentRuntime = await getAgentRuntime();
97
99
  const workspaceDir = agentRuntime.resolveAgentWorkspaceDir(params.cfg, params.account.agentId);
100
+ const agentDir = agentRuntime.resolveAgentDir(params.cfg, params.account.agentId);
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
+ });
98
116
  await agentRuntime.ensureAgentWorkspace?.({ dir: workspaceDir });
99
117
  return agentRuntime.runEmbeddedAgent({
100
118
  sessionId,
101
- sessionKey: routeSessionKey,
119
+ sessionFile,
120
+ sessionKey: canonicalSessionKey,
102
121
  agentId: params.account.agentId,
103
122
  messageChannel: "loggie",
104
123
  messageProvider: "loggie",
@@ -115,7 +134,7 @@ export function createOpenClawTranscriptDispatcher(params) {
115
134
  currentMessageId: event.eventId,
116
135
  chatId: conversationId,
117
136
  workspaceDir,
118
- agentDir: agentRuntime.resolveAgentDir(params.cfg, params.account.agentId),
137
+ agentDir,
119
138
  config: params.cfg,
120
139
  prompt: body,
121
140
  transcriptPrompt: body,
@@ -2,7 +2,7 @@
2
2
  "id": "loggie",
3
3
  "kind": "channel",
4
4
  "name": "Loggie",
5
- "version": "0.1.1",
5
+ "version": "0.1.3",
6
6
  "description": "OpenClaw channel plugin for durable Loggie meeting transcript events over WebSocket.",
7
7
  "activation": {
8
8
  "onStartup": false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loggie-ai/openclaw-plugin",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "OpenClaw channel plugin for Loggie meeting transcript events.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,4 +1,9 @@
1
+ import { dirname, join } from "node:path";
1
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";
2
7
  import type { ResolvedLoggieAccount } from "../account.js";
3
8
  import type { LoggieTranscriptReadyEvent } from "../event-types.js";
4
9
  import { fetchLoggieTranscriptDetail } from "../loggie-client.js";
@@ -137,10 +142,27 @@ export function createOpenClawTranscriptDispatcher(params: {
137
142
  params.cfg,
138
143
  params.account.agentId,
139
144
  );
145
+ const agentDir = agentRuntime.resolveAgentDir(params.cfg, params.account.agentId);
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
+ });
140
161
  await agentRuntime.ensureAgentWorkspace?.({ dir: workspaceDir });
141
162
  return agentRuntime.runEmbeddedAgent({
142
163
  sessionId,
143
- sessionKey: routeSessionKey,
164
+ sessionFile,
165
+ sessionKey: canonicalSessionKey,
144
166
  agentId: params.account.agentId,
145
167
  messageChannel: "loggie",
146
168
  messageProvider: "loggie",
@@ -157,7 +179,7 @@ export function createOpenClawTranscriptDispatcher(params: {
157
179
  currentMessageId: event.eventId,
158
180
  chatId: conversationId,
159
181
  workspaceDir,
160
- agentDir: agentRuntime.resolveAgentDir(params.cfg, params.account.agentId),
182
+ agentDir,
161
183
  config: params.cfg,
162
184
  prompt: body,
163
185
  transcriptPrompt: body,