@xfxstudio/claworld 0.2.10-beta.2 → 0.2.10-beta.3
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
CHANGED
package/package.json
CHANGED
|
@@ -454,14 +454,39 @@ function parseBindingLine(text = '', { agentId, accountId } = {}) {
|
|
|
454
454
|
.find((line) => line === `- ${agentId} <- claworld accountId=${accountId}`) || null;
|
|
455
455
|
}
|
|
456
456
|
|
|
457
|
+
function normalizePathSuffix(value = '') {
|
|
458
|
+
return String(value || '').replace(/\\/g, '/').replace(/\/+$/, '');
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
function isInstallerManagedLocalSourceRecord(installRecord = {}) {
|
|
462
|
+
const source = normalizeText(installRecord.source, null);
|
|
463
|
+
if (source !== 'path') {
|
|
464
|
+
return false;
|
|
465
|
+
}
|
|
466
|
+
const spec = normalizeText(installRecord.spec, null) || normalizeText(installRecord.resolvedSpec, null);
|
|
467
|
+
if (!spec || !spec.startsWith('@xfxstudio/claworld@')) {
|
|
468
|
+
return false;
|
|
469
|
+
}
|
|
470
|
+
const installPath = normalizePathSuffix(installRecord.installPath);
|
|
471
|
+
const sourcePath = normalizePathSuffix(installRecord.sourcePath);
|
|
472
|
+
return (
|
|
473
|
+
installPath.endsWith('/extensions/claworld')
|
|
474
|
+
&& sourcePath.endsWith('/extensions/claworld/node_modules/@xfxstudio/claworld')
|
|
475
|
+
);
|
|
476
|
+
}
|
|
477
|
+
|
|
457
478
|
function inspectTrackedClaworldPluginInstall(config = {}) {
|
|
458
479
|
const installRecord = ensureObject(config?.plugins?.installs?.claworld);
|
|
459
480
|
const tracked = Object.keys(installRecord).length > 0;
|
|
460
|
-
const
|
|
481
|
+
const recordedSource = normalizeText(installRecord.source, null);
|
|
482
|
+
const source = isInstallerManagedLocalSourceRecord(installRecord)
|
|
483
|
+
? 'installer_npm'
|
|
484
|
+
: recordedSource;
|
|
461
485
|
return {
|
|
462
486
|
tracked,
|
|
463
487
|
updateable: tracked && TRACKED_PLUGIN_UPDATEABLE_SOURCES.has(source),
|
|
464
488
|
source,
|
|
489
|
+
recordedSource,
|
|
465
490
|
spec: normalizeText(installRecord.spec, null),
|
|
466
491
|
resolvedSpec: normalizeText(installRecord.resolvedSpec, null),
|
|
467
492
|
resolvedVersion: normalizeText(installRecord.resolvedVersion, null),
|
|
@@ -597,9 +622,9 @@ async function installPublishedClaworldPackageToLocalSource({
|
|
|
597
622
|
sourcePath,
|
|
598
623
|
resolvedVersion,
|
|
599
624
|
pluginConfig: {
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
source: '
|
|
625
|
+
installs: {
|
|
626
|
+
claworld: {
|
|
627
|
+
source: 'path',
|
|
603
628
|
spec: installSource,
|
|
604
629
|
resolvedSpec: installSource,
|
|
605
630
|
...(resolvedVersion ? { resolvedVersion } : {}),
|
|
@@ -972,6 +997,7 @@ export async function ensureClaworldPluginInstalled({
|
|
|
972
997
|
installMode === 'npm'
|
|
973
998
|
&& trackedInstall.tracked
|
|
974
999
|
&& trackedInstall.source === 'installer_npm'
|
|
1000
|
+
&& trackedInstall.recordedSource === 'path'
|
|
975
1001
|
&& normalizeText(trackedInstall.sourcePath, null)
|
|
976
1002
|
);
|
|
977
1003
|
if (
|
|
@@ -1614,7 +1640,7 @@ async function reconcileManagedClaworldRuntime({
|
|
|
1614
1640
|
});
|
|
1615
1641
|
|
|
1616
1642
|
const transformed = applyClaworldBootstrapConfig(currentConfig, managedOptions);
|
|
1617
|
-
const configChanged = JSON.stringify(
|
|
1643
|
+
const configChanged = JSON.stringify(currentConfigState.config) !== JSON.stringify(transformed.config);
|
|
1618
1644
|
const backupPath = configChanged
|
|
1619
1645
|
? await backupConfigIfPresent(configPath, currentConfigState.existed, dryRun)
|
|
1620
1646
|
: null;
|