@xfxstudio/claworld 0.2.10-beta.2 → 0.2.11
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
|
@@ -131,6 +131,7 @@ export function parseInstallerCliArgs(argv = process.argv.slice(2), env = proces
|
|
|
131
131
|
agentId: 'main',
|
|
132
132
|
workspace: null,
|
|
133
133
|
displayName: null,
|
|
134
|
+
pluginInstallSource: CLAWORLD_INSTALLER_DEFAULT_PLUGIN_SOURCE,
|
|
134
135
|
toolProfile: null,
|
|
135
136
|
},
|
|
136
137
|
doctor: {
|
|
@@ -234,6 +235,7 @@ export function parseInstallerCliArgs(argv = process.argv.slice(2), env = proces
|
|
|
234
235
|
break;
|
|
235
236
|
case '--plugin-source':
|
|
236
237
|
options.install.pluginInstallSource = nextValue(remaining, index);
|
|
238
|
+
options.update.pluginInstallSource = options.install.pluginInstallSource;
|
|
237
239
|
index += 1;
|
|
238
240
|
break;
|
|
239
241
|
case '--json':
|
|
@@ -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 (
|
|
@@ -1092,6 +1118,7 @@ export async function updateTrackedClaworldPluginInstall({
|
|
|
1092
1118
|
configPath = null,
|
|
1093
1119
|
stateDir = DEFAULT_OPENCLAW_STATE_DIR,
|
|
1094
1120
|
config = {},
|
|
1121
|
+
installSource = null,
|
|
1095
1122
|
commandRunner = defaultCommandRunner,
|
|
1096
1123
|
cwd = process.cwd(),
|
|
1097
1124
|
env = process.env,
|
|
@@ -1118,7 +1145,10 @@ export async function updateTrackedClaworldPluginInstall({
|
|
|
1118
1145
|
|
|
1119
1146
|
if (trackedInstall.source === 'installer_npm') {
|
|
1120
1147
|
const localInstall = await installPublishedClaworldPackageToLocalSource({
|
|
1121
|
-
installSource:
|
|
1148
|
+
installSource: normalizeText(
|
|
1149
|
+
installSource,
|
|
1150
|
+
trackedInstall.spec || CLAWORLD_INSTALLER_DEFAULT_PLUGIN_SOURCE,
|
|
1151
|
+
),
|
|
1122
1152
|
configPath,
|
|
1123
1153
|
commandRunner,
|
|
1124
1154
|
cwd,
|
|
@@ -1614,7 +1644,7 @@ async function reconcileManagedClaworldRuntime({
|
|
|
1614
1644
|
});
|
|
1615
1645
|
|
|
1616
1646
|
const transformed = applyClaworldBootstrapConfig(currentConfig, managedOptions);
|
|
1617
|
-
const configChanged = JSON.stringify(
|
|
1647
|
+
const configChanged = JSON.stringify(currentConfigState.config) !== JSON.stringify(transformed.config);
|
|
1618
1648
|
const backupPath = configChanged
|
|
1619
1649
|
? await backupConfigIfPresent(configPath, currentConfigState.existed, dryRun)
|
|
1620
1650
|
: null;
|
|
@@ -1816,6 +1846,7 @@ export async function runClaworldInstallerUpdate({
|
|
|
1816
1846
|
agentId = DEFAULT_CLAWORLD_AGENT_ID,
|
|
1817
1847
|
workspace = null,
|
|
1818
1848
|
displayName = null,
|
|
1849
|
+
pluginInstallSource = null,
|
|
1819
1850
|
toolProfile = null,
|
|
1820
1851
|
approvalMode = null,
|
|
1821
1852
|
sessionDmScope = null,
|
|
@@ -1856,6 +1887,7 @@ export async function runClaworldInstallerUpdate({
|
|
|
1856
1887
|
configPath: resolvedConfigPath,
|
|
1857
1888
|
stateDir: resolvedStateDir,
|
|
1858
1889
|
config: currentConfigState.config,
|
|
1890
|
+
installSource: pluginInstallSource,
|
|
1859
1891
|
commandRunner,
|
|
1860
1892
|
cwd,
|
|
1861
1893
|
env,
|