@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 sessionFile = join(agentDir, "sessions", `${sessionId}.jsonl`);
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: routeSessionKey,
120
+ sessionKey: canonicalSessionKey,
106
121
  agentId: params.account.agentId,
107
122
  messageChannel: "loggie",
108
123
  messageProvider: "loggie",
@@ -2,7 +2,7 @@
2
2
  "id": "loggie",
3
3
  "kind": "channel",
4
4
  "name": "Loggie",
5
- "version": "0.1.2",
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.2",
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,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 sessionFile = join(agentDir, "sessions", `${sessionId}.jsonl`);
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: routeSessionKey,
165
+ sessionKey: canonicalSessionKey,
148
166
  agentId: params.account.agentId,
149
167
  messageChannel: "loggie",
150
168
  messageProvider: "loggie",