principles-disciple 1.141.0 → 1.143.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.
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/scripts/sync-plugin.mjs +33 -22
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "principles-disciple",
|
|
3
3
|
"name": "Principles Disciple",
|
|
4
4
|
"description": "Evolutionary programming agent framework with strategic guardrails and reflection loops.",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.143.0",
|
|
6
6
|
"activation": {
|
|
7
7
|
"onCapabilities": [
|
|
8
8
|
"hook"
|
package/package.json
CHANGED
package/scripts/sync-plugin.mjs
CHANGED
|
@@ -871,9 +871,9 @@ function copyDir(src, dest) {
|
|
|
871
871
|
}
|
|
872
872
|
|
|
873
873
|
/**
|
|
874
|
-
* Inject local workspace packages (monorepo) into node_modules
|
|
875
|
-
* @principles/core
|
|
876
|
-
*
|
|
874
|
+
* Inject local workspace packages (monorepo) into node_modules after npm install.
|
|
875
|
+
* @principles/core from the local monorepo is authoritative because the
|
|
876
|
+
* npm-published package line lacks exports required by the current pd-cli.
|
|
877
877
|
*/
|
|
878
878
|
function injectLocalWorkspacePackages() {
|
|
879
879
|
const monorepoModules = join(SOURCE_DIR, '..', '..', 'node_modules', '@principles', 'core');
|
|
@@ -885,24 +885,25 @@ function injectLocalWorkspacePackages() {
|
|
|
885
885
|
}
|
|
886
886
|
|
|
887
887
|
console.log(' 📦 Injecting local workspace packages (@principles/core)...');
|
|
888
|
+
|
|
889
|
+
// Remove the target FIRST, because cp -rL on Windows copies the source
|
|
890
|
+
// directory INTO the existing target, creating a nested core/core/ that
|
|
891
|
+
// leaves the original npm-version package.json untouched. We must start
|
|
892
|
+
// with a clean slate so the local version is authoritative.
|
|
893
|
+
if (existsSync(targetModules)) {
|
|
894
|
+
rmSync(targetModules, { recursive: true, force: true });
|
|
895
|
+
}
|
|
896
|
+
|
|
888
897
|
mkdirSync(dirname(targetModules), { recursive: true });
|
|
889
|
-
//
|
|
890
|
-
|
|
898
|
+
// Use copyDir (Node-based, no cp -rL semantics trap) for reliable
|
|
899
|
+
// cross-platform overwrite. cpSync creates symlinks on Windows for
|
|
900
|
+
// symlinked dirs — copyDir dereferences by reading file contents.
|
|
891
901
|
try {
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
} catch {
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
copyDir(monorepoModules, targetModules);
|
|
898
|
-
injected = true;
|
|
899
|
-
} catch (copyErr) {
|
|
900
|
-
console.warn(' ⚠️ Failed to inject @principles/core from monorepo: ' + copyErr.message);
|
|
901
|
-
console.warn(' ⚠️ npm install --production may fail if @principles/core is not published');
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
|
-
if (injected && !existsSync(targetModules)) {
|
|
905
|
-
console.warn(' ⚠️ Injection reported success but target not found: ' + targetModules);
|
|
902
|
+
copyDir(monorepoModules, targetModules);
|
|
903
|
+
console.log(' ✅ @principles/core local build injected');
|
|
904
|
+
} catch (copyErr) {
|
|
905
|
+
console.warn(' ⚠️ Failed to inject @principles/core from monorepo: ' + copyErr.message);
|
|
906
|
+
console.warn(' ⚠️ npm version remains in place — pd-cli may fail if exports differ');
|
|
906
907
|
}
|
|
907
908
|
}
|
|
908
909
|
|
|
@@ -1082,7 +1083,7 @@ function restartGatewayWindows() {
|
|
|
1082
1083
|
execSync(`wmic process where "ProcessId=${pidTrim}" call terminate`, { stdio: 'ignore' });
|
|
1083
1084
|
} catch { /* ignore individual failures */ }
|
|
1084
1085
|
}
|
|
1085
|
-
execSync('timeout /t 3 /nobreak
|
|
1086
|
+
execSync('timeout /t 3 /nobreak', { shell: true, stdio: 'ignore' });
|
|
1086
1087
|
}
|
|
1087
1088
|
} catch { /* no existing processes */ }
|
|
1088
1089
|
|
|
@@ -1146,7 +1147,7 @@ function restartGatewayWindows() {
|
|
|
1146
1147
|
}
|
|
1147
1148
|
} catch { /* port not listening yet */ }
|
|
1148
1149
|
try {
|
|
1149
|
-
execSync('timeout /t 1 /nobreak
|
|
1150
|
+
execSync('timeout /t 1 /nobreak', { shell: true, stdio: 'ignore' });
|
|
1150
1151
|
} catch { /* ignore */ }
|
|
1151
1152
|
}
|
|
1152
1153
|
|
|
@@ -1309,8 +1310,18 @@ function main() {
|
|
|
1309
1310
|
syncFilteredManifest(args.lang);
|
|
1310
1311
|
syncPdCli();
|
|
1311
1312
|
|
|
1312
|
-
injectLocalWorkspacePackages
|
|
1313
|
+
// IMPORTANT: npm install must run FIRST, then injectLocalWorkspacePackages
|
|
1314
|
+
// overwrites @principles/core with the local monorepo version.
|
|
1315
|
+
//
|
|
1316
|
+
// Why: @principles/core on npm (v1.164.0-1.174.0, from a different publish
|
|
1317
|
+
// line) is semantically "^1.74.1"-compatible but its exports field does NOT
|
|
1318
|
+
// include ./principle-tree-ledger that pd-cli/health.js requires. The npm
|
|
1319
|
+
// registry version must never be used — only the local monorepo build has
|
|
1320
|
+
// the correct exports. Injecting BEFORE npm install is useless because npm
|
|
1321
|
+
// overwrites the injected copy. The authoritative source is always the
|
|
1322
|
+
// local monorepo, applied AFTER npm install.
|
|
1313
1323
|
installTargetDependencies();
|
|
1324
|
+
injectLocalWorkspacePackages();
|
|
1314
1325
|
verifyInjectedWorkspaceDeps();
|
|
1315
1326
|
verifyPdCliShim();
|
|
1316
1327
|
|