maskweaver 0.9.7 → 0.9.9
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/dist/plugin/index.js +73 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
package/dist/plugin/index.js
CHANGED
|
@@ -34,6 +34,13 @@ const REMOVED_WEAVE_COMMAND_FILES = [
|
|
|
34
34
|
'weave-task.md',
|
|
35
35
|
'weave-task-auto.md',
|
|
36
36
|
'wave-task-auto.md',
|
|
37
|
+
'weave-approve-plan.md',
|
|
38
|
+
'weave-design.md',
|
|
39
|
+
'weave-flow.md',
|
|
40
|
+
'weave-plan.md',
|
|
41
|
+
'weave-research.md',
|
|
42
|
+
'weave-spec.md',
|
|
43
|
+
'weave-switch.md',
|
|
37
44
|
];
|
|
38
45
|
function getAssetsDir() {
|
|
39
46
|
try {
|
|
@@ -587,7 +594,73 @@ function playCompletionSound(config) {
|
|
|
587
594
|
}
|
|
588
595
|
}
|
|
589
596
|
let state = null;
|
|
597
|
+
const OPENCODE_PACKAGES_DIR = path.join(os.homedir(), '.cache', 'opencode', 'packages');
|
|
598
|
+
const MASKWEAVER_PACKAGE_GLOB = 'maskweaver@*';
|
|
599
|
+
function getCacheVersion() {
|
|
600
|
+
if (!fs.existsSync(OPENCODE_PACKAGES_DIR))
|
|
601
|
+
return null;
|
|
602
|
+
const entries = fs.readdirSync(OPENCODE_PACKAGES_DIR);
|
|
603
|
+
for (const entry of entries) {
|
|
604
|
+
if (!entry.startsWith('maskweaver@'))
|
|
605
|
+
continue;
|
|
606
|
+
const pkgDir = path.join(OPENCODE_PACKAGES_DIR, entry, 'node_modules', 'maskweaver');
|
|
607
|
+
const pkgJsonPath = path.join(pkgDir, 'package.json');
|
|
608
|
+
if (!fs.existsSync(pkgJsonPath))
|
|
609
|
+
continue;
|
|
610
|
+
try {
|
|
611
|
+
const pkg = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf-8'));
|
|
612
|
+
return { version: pkg.version, pkgDir: path.join(OPENCODE_PACKAGES_DIR, entry) };
|
|
613
|
+
}
|
|
614
|
+
catch {
|
|
615
|
+
continue;
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
return null;
|
|
619
|
+
}
|
|
620
|
+
function getLatestNpmVersion() {
|
|
621
|
+
try {
|
|
622
|
+
const result = spawnSync('npm', ['view', 'maskweaver', 'version'], {
|
|
623
|
+
encoding: 'utf-8',
|
|
624
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
625
|
+
timeout: 10000,
|
|
626
|
+
windowsHide: true,
|
|
627
|
+
});
|
|
628
|
+
if (result.status === 0 && result.stdout) {
|
|
629
|
+
return result.stdout.trim();
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
catch { }
|
|
633
|
+
return null;
|
|
634
|
+
}
|
|
635
|
+
function checkAndInvalidateCache() {
|
|
636
|
+
const cached = getCacheVersion();
|
|
637
|
+
if (!cached) {
|
|
638
|
+
return { invalidated: false, cachedVersion: null, latestVersion: null };
|
|
639
|
+
}
|
|
640
|
+
if (cached.version === VERSION) {
|
|
641
|
+
return { invalidated: false, cachedVersion: cached.version, latestVersion: null };
|
|
642
|
+
}
|
|
643
|
+
const latest = getLatestNpmVersion();
|
|
644
|
+
if (latest && latest !== cached.version) {
|
|
645
|
+
try {
|
|
646
|
+
fs.rmSync(cached.pkgDir, { recursive: true, force: true });
|
|
647
|
+
return { invalidated: true, cachedVersion: cached.version, latestVersion: latest };
|
|
648
|
+
}
|
|
649
|
+
catch {
|
|
650
|
+
return { invalidated: false, cachedVersion: cached.version, latestVersion: latest };
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
return { invalidated: false, cachedVersion: cached.version, latestVersion: latest };
|
|
654
|
+
}
|
|
590
655
|
export const MaskweaverPlugin = async ({ client, directory, project, worktree, $, serverUrl }) => {
|
|
656
|
+
const cacheCheck = checkAndInvalidateCache();
|
|
657
|
+
if (cacheCheck.invalidated) {
|
|
658
|
+
pluginLog(client, 'warn', `Stale plugin cache detected (v${cacheCheck.cachedVersion}). Cleared — v${cacheCheck.latestVersion} will install on next restart.`);
|
|
659
|
+
pluginLog(client, 'warn', `Please restart OpenCode to activate maskweaver v${VERSION}.`);
|
|
660
|
+
}
|
|
661
|
+
else if (cacheCheck.cachedVersion && cacheCheck.cachedVersion !== VERSION) {
|
|
662
|
+
pluginLog(client, 'info', `Plugin cache v${cacheCheck.cachedVersion} — current is v${VERSION}. Restart recommended.`);
|
|
663
|
+
}
|
|
591
664
|
const pluginConfig = loadPluginConfig(directory, { client, verbose: false });
|
|
592
665
|
const configErrors = validateConfig(pluginConfig);
|
|
593
666
|
if (configErrors.length > 0) {
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.9.
|
|
1
|
+
export declare const VERSION = "0.9.9";
|
|
2
2
|
export declare function getVersionString(): string;
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "maskweaver",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.9",
|
|
4
4
|
"description": "AI Expert Persona System - Give your AI coding assistant expert personalities (가면술사)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -138,11 +138,11 @@
|
|
|
138
138
|
"@rollup/rollup-win32-x64-msvc": "^4.57.1",
|
|
139
139
|
"@types/better-sqlite3": "^7.6.13",
|
|
140
140
|
"@types/node": "^20.0.0",
|
|
141
|
-
"better-sqlite3": "^12.
|
|
141
|
+
"better-sqlite3": "^12.9.0",
|
|
142
142
|
"typescript": "^5.3.0",
|
|
143
143
|
"vitest": "^4.0.18"
|
|
144
144
|
},
|
|
145
145
|
"optionalDependencies": {
|
|
146
|
-
"better-sqlite3": "^9.
|
|
146
|
+
"better-sqlite3": "^12.9.0"
|
|
147
147
|
}
|
|
148
148
|
}
|