@codemem/opencode-plugin 0.27.0 → 0.28.0

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.
@@ -15,7 +15,7 @@ import {
15
15
 
16
16
  const TRUTHY_VALUES = ["1", "true", "yes"];
17
17
  const DISABLED_VALUES = ["0", "false", "off"];
18
- const PINNED_BACKEND_VERSION = "0.27.0";
18
+ const PINNED_BACKEND_VERSION = "0.28.0";
19
19
  const COMPAT_CHECK_DELAY_MS = 1500;
20
20
  const COMPAT_CHECK_CACHE_TTL_MS = 5 * 60 * 1000;
21
21
 
@@ -217,6 +217,30 @@ const buildPackArgs = ({ query, filesModified, injectLimit, injectTokenBudget })
217
217
  return appendWorkingSetFileArgs(args, workingSetFiles);
218
218
  };
219
219
 
220
+ const parsePackText = (stdout) => {
221
+ if (!stdout || !stdout.trim()) {
222
+ return "";
223
+ }
224
+ try {
225
+ const payload = JSON.parse(stdout);
226
+ return (payload?.pack_text || "").trim();
227
+ } catch {
228
+ return "";
229
+ }
230
+ };
231
+
232
+ const parsePackMetrics = (stdout) => {
233
+ if (!stdout || !stdout.trim()) {
234
+ return null;
235
+ }
236
+ try {
237
+ const payload = JSON.parse(stdout);
238
+ return payload?.metrics || null;
239
+ } catch {
240
+ return null;
241
+ }
242
+ };
243
+
220
244
  const applyInjectedContextToOutput = async ({
221
245
  injectEnabled,
222
246
  input,
@@ -1475,30 +1499,6 @@ export const OpencodeMemPlugin = async ({
1475
1499
  };
1476
1500
  };
1477
1501
 
1478
- const parsePackText = (stdout) => {
1479
- if (!stdout || !stdout.trim()) {
1480
- return "";
1481
- }
1482
- try {
1483
- const payload = JSON.parse(stdout);
1484
- return (payload?.pack_text || "").trim();
1485
- } catch (err) {
1486
- return "";
1487
- }
1488
- };
1489
-
1490
- const parsePackMetrics = (stdout) => {
1491
- if (!stdout || !stdout.trim()) {
1492
- return null;
1493
- }
1494
- try {
1495
- const payload = JSON.parse(stdout);
1496
- return payload?.metrics || null;
1497
- } catch (err) {
1498
- return null;
1499
- }
1500
- };
1501
-
1502
1502
  const redactLog = (value, limit = 400) => {
1503
1503
  if (!value) return "";
1504
1504
  const masked = String(value).replace(/(Bearer\s+)[^\s]+/gi, "$1[redacted]");
@@ -2105,6 +2105,8 @@ export const __testUtils = {
2105
2105
  resolveProjectName,
2106
2106
  buildInjectQuery,
2107
2107
  buildPackArgs,
2108
+ parsePackText,
2109
+ parsePackMetrics,
2108
2110
  applyInjectedContextToOutput,
2109
2111
  buildRunnerArgs,
2110
2112
  appendWorkingSetFileArgs,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemem/opencode-plugin",
3
- "version": "0.27.0",
3
+ "version": "0.28.0",
4
4
  "description": "CodeMem plugin for OpenCode",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -18,7 +18,7 @@
18
18
  ".opencode/lib/"
19
19
  ],
20
20
  "dependencies": {
21
- "@opencode-ai/plugin": "1.4.6"
21
+ "@opencode-ai/plugin": "1.14.19"
22
22
  },
23
23
  "repository": {
24
24
  "type": "git",