opencode-work-context 0.12.0 → 0.12.1

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.
package/README.md CHANGED
@@ -299,9 +299,9 @@ For an existing JSONC configuration, add the equivalent entry manually:
299
299
  }
300
300
  ```
301
301
 
302
- Re-running `activate` also migrates work-context entries previously generated
303
- under the unsupported legacy `plugins` field. Unrelated legacy entries are
304
- preserved rather than activated or removed implicitly.
302
+ Re-running `activate` or `deactivate` migrates every entry from the unsupported
303
+ legacy `plugins` field into the canonical `plugin` array, preserves entry order,
304
+ removes exact duplicates, and deletes `plugins`.
305
305
 
306
306
  Update managed activation from one activated project with an exact version:
307
307
 
@@ -197,11 +197,17 @@ function activate(enabled, force) {
197
197
  || item.startsWith(`${packageManifest.name}@`)
198
198
  || item === "-work-context"
199
199
  );
200
- config.plugin = [...(config.plugin || []).filter((item) => !isWorkContextEntry(item)), entry];
201
- if (config.plugins) {
202
- config.plugins = config.plugins.filter((item) => !isWorkContextEntry(item));
203
- if (config.plugins.length === 0) delete config.plugins;
204
- }
200
+ const seenPluginEntries = new Set();
201
+ config.plugin = [...(config.plugin || []), ...(config.plugins || [])]
202
+ .filter((item) => !isWorkContextEntry(item))
203
+ .filter((item) => {
204
+ const key = JSON.stringify(item);
205
+ if (seenPluginEntries.has(key)) return false;
206
+ seenPluginEntries.add(key);
207
+ return true;
208
+ });
209
+ config.plugin.push(entry);
210
+ delete config.plugins;
205
211
  managedTuiConfig.plugin = [...(managedTuiConfig.plugin || []).filter((item) => !isWorkContextEntry(item)), entry];
206
212
  const files = new Map([
207
213
  [configRelative, JSON.stringify(config, null, 2) + "\n"],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "opencode-work-context",
3
3
  "type": "module",
4
- "version": "0.12.0",
4
+ "version": "0.12.1",
5
5
  "description": "Filesystem work-context core and OpenCode adapter",
6
6
  "license": "MIT",
7
7
  "author": {