opencode-manifold 0.4.5 → 0.4.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.
package/README.md CHANGED
@@ -306,6 +306,28 @@ rm -rf ~/.config/opencode/manifold/ ~/.config/opencode/commands/manifold-init.md
306
306
 
307
307
  To fully uninstall the plugin, also remove `"opencode-manifold"` from the `plugin` array in your global or project `opencode.json`.
308
308
 
309
+ ### Complete Clean Uninstall
310
+ # Mac:
311
+ OpenCode caches plugins in multiple locations. To fully clear all cached versions before reinstalling:
312
+
313
+ ```bash
314
+ # Remove plugin from all cache locations
315
+ rm -rf ~/node_modules/opencode-manifold
316
+ rm -rf ~/.cache/opencode/packages/opencode-manifold@latest
317
+ rm -rf ~/.config/opencode/manifold/
318
+ rm -rf ~/.config/opencode/commands/manifold-init.md
319
+
320
+ # Then restart opencode and run /manifold-init
321
+ ```
322
+
323
+ This ensures you're running the latest version after updates.
324
+
325
+ # Win:
326
+ I have no clue. Use linux.
327
+
328
+ # Linux:
329
+ Still have no clue but I know you can handle it.
330
+
309
331
  ---
310
332
 
311
333
  ## License
package/dist/index.js CHANGED
@@ -4,9 +4,19 @@ import { existsSync } from "fs";
4
4
  import { join, dirname } from "path";
5
5
  import { fileURLToPath } from "url";
6
6
  import { homedir } from "os";
7
+ import { createRequire } from "module";
7
8
  var __dirname2 = dirname(fileURLToPath(import.meta.url));
9
+ var require2 = createRequire(import.meta.url);
8
10
  var bundledTemplatesDir = join(__dirname2, "..", "src", "templates");
9
11
  var globalTemplatesDir = join(homedir(), ".config", "opencode", "manifold");
12
+ async function getPluginVersion() {
13
+ try {
14
+ const packageJson = require2(join(__dirname2, "..", "package.json"));
15
+ return packageJson.version || "unknown";
16
+ } catch {
17
+ return "unknown";
18
+ }
19
+ }
10
20
  async function dirHasContent(dirPath) {
11
21
  if (!existsSync(dirPath))
12
22
  return false;
@@ -38,65 +48,6 @@ async function copyMissingFiles(src, dest) {
38
48
  }
39
49
  return copied;
40
50
  }
41
- async function mergeOpencodeConfig(projectDir) {
42
- const configPath = join(projectDir, "opencode.json");
43
- const templateConfigPath = join(globalTemplatesDir, "config", "opencode.json");
44
- if (!existsSync(templateConfigPath))
45
- return;
46
- const templateConfig = JSON.parse(await readFile(templateConfigPath, "utf-8"));
47
- if (!existsSync(configPath)) {
48
- await writeFile(configPath, JSON.stringify(templateConfig, null, 2));
49
- return;
50
- }
51
- const existing = JSON.parse(await readFile(configPath, "utf-8"));
52
- let changed = false;
53
- if (templateConfig.agent?.manifold?.skill) {
54
- if (!existing.agent) {
55
- existing.agent = {};
56
- }
57
- if (!existing.agent.manifold) {
58
- existing.agent.manifold = {};
59
- }
60
- if (!existing.agent.manifold.skill) {
61
- existing.agent.manifold.skill = templateConfig.agent.manifold.skill;
62
- changed = true;
63
- } else if (Array.isArray(existing.agent.manifold.skill) && Array.isArray(templateConfig.agent.manifold.skill)) {
64
- const existingSkills = new Set(existing.agent.manifold.skill);
65
- let addedSkill = false;
66
- for (const skill of templateConfig.agent.manifold.skill) {
67
- if (!existingSkills.has(skill)) {
68
- existing.agent.manifold.skill.push(skill);
69
- addedSkill = true;
70
- }
71
- }
72
- if (addedSkill) {
73
- changed = true;
74
- }
75
- }
76
- }
77
- if (templateConfig.agent?.manifold?.skill) {
78
- const skillsToAdd = templateConfig.agent.manifold.skill;
79
- if (!existing.permission) {
80
- existing.permission = {};
81
- }
82
- if (!existing.permission.skill) {
83
- existing.permission.skill = {};
84
- }
85
- let permissionChanged = false;
86
- for (const skill of skillsToAdd) {
87
- if (existing.permission.skill[skill] === undefined) {
88
- existing.permission.skill[skill] = "allow";
89
- permissionChanged = true;
90
- }
91
- }
92
- if (permissionChanged) {
93
- changed = true;
94
- }
95
- }
96
- if (changed) {
97
- await writeFile(configPath, JSON.stringify(existing, null, 2));
98
- }
99
- }
100
51
  async function ensureGlobalTemplates(ctx) {
101
52
  await ctx.client.app.log({
102
53
  body: {
@@ -160,11 +111,9 @@ async function initProject(directory, client) {
160
111
  if (manifoldCopied.length > 0) {
161
112
  initialized.push(`Manifold/ (${manifoldCopied.join(", ")})`);
162
113
  }
163
- const configPath = join(directory, "opencode.json");
164
- if (!existsSync(configPath) || !JSON.parse(await readFile(configPath, "utf-8")).agent?.manifold) {
165
- await mergeOpencodeConfig(directory);
166
- initialized.push("opencode.json");
167
- }
114
+ const version = await getPluginVersion();
115
+ await writeFile(join(directory, "Manifold", "VERSION"), version + `
116
+ `);
168
117
  await client.app.log({
169
118
  body: {
170
119
  service: "opencode-manifold",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-manifold",
3
- "version": "0.4.5",
3
+ "version": "0.4.7",
4
4
  "description": "Multi-agent development system for opencode with persistent knowledge",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -1,7 +1,10 @@
1
1
  ---
2
2
  description: Orchestrates development by reading plans and dispatching tasks
3
3
  mode: primary
4
+ color: #6024bf
4
5
  permission:
6
+ skill:
7
+ manifold-workflow: allow
5
8
  edit: deny
6
9
  bash: deny
7
10
  read: allow
@@ -0,0 +1 @@
1
+ 0.4.6
@@ -1,13 +0,0 @@
1
- {
2
- "$schema": "https://opencode.ai/config.json",
3
- "agent": {
4
- "manifold": {
5
- "skill": ["manifold-workflow"]
6
- }
7
- },
8
- "permission": {
9
- "skill": {
10
- "manifold-workflow": "allow"
11
- }
12
- }
13
- }