rol-websocket-channel 1.3.7 → 1.4.2
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/index.js +4 -0
- package/dist/src/admin/methods/pairing.js +0 -9
- package/index.ts +4 -0
- package/package.json +1 -1
- package/src/admin/methods/pairing.ts +0 -14
package/dist/index.js
CHANGED
|
@@ -393,6 +393,10 @@ async function handleIncomingMessage(payload, account, cfg, runtime, log, mqttTo
|
|
|
393
393
|
type: "receiver",
|
|
394
394
|
trace_id: traceId,
|
|
395
395
|
source: "ai",
|
|
396
|
+
meta: {
|
|
397
|
+
'agentId': resolvedAccountId,
|
|
398
|
+
'sessionKey': resolvedSessionKey
|
|
399
|
+
},
|
|
396
400
|
data: payload,
|
|
397
401
|
timestamp: Date.now(),
|
|
398
402
|
};
|
|
@@ -15,7 +15,6 @@ export async function pairWithKey(options, context) {
|
|
|
15
15
|
}
|
|
16
16
|
const configPath = path.join(context.openclawRoot, 'openclaw.json');
|
|
17
17
|
const config = await loadConfig(configPath);
|
|
18
|
-
ensurePluginInstalled(config);
|
|
19
18
|
const existingMqttUrl = resolveExistingMqttUrl(config);
|
|
20
19
|
const endpoint = buildPairEndpoint(options.endpoint, config);
|
|
21
20
|
const payload = await exchangePairKey(key, endpoint, options.auth, existingMqttUrl);
|
|
@@ -43,14 +42,6 @@ async function loadConfig(configPath) {
|
|
|
43
42
|
}
|
|
44
43
|
return await readJsonFile(configPath);
|
|
45
44
|
}
|
|
46
|
-
function ensurePluginInstalled(config) {
|
|
47
|
-
const allowed = Array.isArray(config.plugins?.allow) ? config.plugins.allow : [];
|
|
48
|
-
const installs = config.plugins?.installs;
|
|
49
|
-
const hasInstallRecord = Boolean(installs && typeof installs === 'object' && DEFAULT_PLUGIN_ID in installs);
|
|
50
|
-
if (!allowed.includes(DEFAULT_PLUGIN_ID) && !hasInstallRecord) {
|
|
51
|
-
throwPairingError('PAIR_PLUGIN_NOT_INSTALLED', `plugin not installed or not allowed: ${DEFAULT_PLUGIN_ID}`);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
45
|
async function exchangePairKey(key, endpoint, authOverride, existingMqttUrl) {
|
|
55
46
|
const auth = pickString(authOverride);
|
|
56
47
|
const headers = {
|
package/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -57,7 +57,6 @@ export async function pairWithKey(
|
|
|
57
57
|
|
|
58
58
|
const configPath = path.join(context.openclawRoot, 'openclaw.json');
|
|
59
59
|
const config = await loadConfig(configPath);
|
|
60
|
-
ensurePluginInstalled(config);
|
|
61
60
|
|
|
62
61
|
const existingMqttUrl = resolveExistingMqttUrl(config);
|
|
63
62
|
const endpoint = buildPairEndpoint(options.endpoint, config);
|
|
@@ -90,19 +89,6 @@ async function loadConfig(configPath: string): Promise<OpenClawConfig> {
|
|
|
90
89
|
return await readJsonFile<OpenClawConfig>(configPath);
|
|
91
90
|
}
|
|
92
91
|
|
|
93
|
-
function ensurePluginInstalled(config: OpenClawConfig): void {
|
|
94
|
-
const allowed = Array.isArray(config.plugins?.allow) ? config.plugins.allow : [];
|
|
95
|
-
const installs = config.plugins?.installs;
|
|
96
|
-
const hasInstallRecord = Boolean(installs && typeof installs === 'object' && DEFAULT_PLUGIN_ID in installs);
|
|
97
|
-
|
|
98
|
-
if (!allowed.includes(DEFAULT_PLUGIN_ID) && !hasInstallRecord) {
|
|
99
|
-
throwPairingError(
|
|
100
|
-
'PAIR_PLUGIN_NOT_INSTALLED',
|
|
101
|
-
`plugin not installed or not allowed: ${DEFAULT_PLUGIN_ID}`
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
92
|
async function exchangePairKey(
|
|
107
93
|
key: string,
|
|
108
94
|
endpoint: string,
|