opencode-translate 0.0.6 → 0.0.7

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/activation.ts +10 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-translate",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "OpenCode plugin that lets the user chat in a configured source language while the main chat loop only sees English.",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
package/src/activation.ts CHANGED
@@ -227,6 +227,16 @@ async function resolveSessionState(
227
227
  directory: string | undefined,
228
228
  sessionID: string,
229
229
  ): Promise<ResolvedSessionState> {
230
+ const cached = sessionStateCache.get(sessionID)
231
+ if (cached !== undefined) {
232
+ return {
233
+ sessionActive: Boolean(cached),
234
+ canActivate: false,
235
+ state: cached ?? undefined,
236
+ storedMessages: [],
237
+ }
238
+ }
239
+
230
240
  const session = unwrapData(
231
241
  await client.session.get({
232
242
  path: { id: sessionID },