metame-cli 1.5.6 → 1.5.8
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/index.js +9 -4
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -303,15 +303,20 @@ function requestDaemonRestart({
|
|
|
303
303
|
// Auto-deploy bundled scripts to ~/.metame/
|
|
304
304
|
// IMPORTANT: daemon.yaml is USER CONFIG — never overwrite it. Only daemon-default.yaml (template) is synced.
|
|
305
305
|
const scriptsDir = path.join(__dirname, 'scripts');
|
|
306
|
-
|
|
307
|
-
|
|
306
|
+
// Auto-detect ALL runtime scripts: daemon-*.js + all other non-test, non-utility .js/.yaml/.sh files.
|
|
307
|
+
// This prevents "missing module" crashes when new files are added without updating a manual list.
|
|
308
|
+
const EXCLUDED_SCRIPTS = new Set(['sync-readme.js', 'test_daemon.js']);
|
|
309
|
+
const BUNDLED_SCRIPTS = (() => {
|
|
308
310
|
try {
|
|
309
|
-
return fs.readdirSync(scriptsDir).filter((f) =>
|
|
311
|
+
return fs.readdirSync(scriptsDir).filter((f) => {
|
|
312
|
+
if (EXCLUDED_SCRIPTS.has(f)) return false;
|
|
313
|
+
if (/\.test\.js$/.test(f)) return false;
|
|
314
|
+
return /\.(js|yaml|sh)$/.test(f);
|
|
315
|
+
});
|
|
310
316
|
} catch {
|
|
311
317
|
return [];
|
|
312
318
|
}
|
|
313
319
|
})();
|
|
314
|
-
const BUNDLED_SCRIPTS = [...new Set([...BUNDLED_BASE_SCRIPTS, ...DAEMON_MODULE_SCRIPTS])];
|
|
315
320
|
|
|
316
321
|
// Protect daemon.yaml: create backup before any sync operation
|
|
317
322
|
const DAEMON_YAML_BACKUP = path.join(METAME_DIR, 'daemon.yaml.bak');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "metame-cli",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.8",
|
|
4
4
|
"description": "The Cognitive Profile Layer for Claude Code. Knows how you think, not just what you said.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"test:daemon-status": "node --test scripts/daemon-restart-status.test.js",
|
|
19
19
|
"start": "node index.js",
|
|
20
20
|
"push": "bash scripts/bin/push-clean.sh",
|
|
21
|
-
"sync:plugin": "
|
|
21
|
+
"sync:plugin": "node -e \"const fs=require('fs'),path=require('path');const ex=new Set(['sync-readme.js','test_daemon.js']);const files=fs.readdirSync('scripts').filter(f=>!ex.has(f)&&!/\\.test\\.js$/.test(f)&&/\\.(js|yaml|sh)$/.test(f));files.forEach(f=>fs.copyFileSync('scripts/'+f,'plugin/scripts/'+f));\" && mkdir -p plugin/scripts/hooks && cp scripts/hooks/*.js plugin/scripts/hooks/ && echo 'Plugin scripts synced'",
|
|
22
22
|
"sync:readme": "node scripts/sync-readme.js",
|
|
23
23
|
"restart:daemon": "node index.js stop 2>/dev/null; sleep 1; node index.js start 2>/dev/null || echo '鈿狅笍 Daemon not running or restart failed'",
|
|
24
24
|
"precommit": "npm run sync:plugin && npm run restart:daemon"
|