@archipelagolab/lobi 1.0.11 → 1.0.12
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/package.json +1 -1
- package/src/account-selection.ts +1 -1
- package/src/channel.ts +1 -1
- package/src/doctor-contract.ts +1 -1
- package/src/doctor.ts +14 -14
- package/src/matrix/account-config.ts +2 -2
- package/src/matrix/client/storage.ts +1 -1
- package/src/matrix/config-paths.ts +1 -1
- package/src/matrix/config-update.ts +1 -1
- package/src/matrix/credentials-read.ts +1 -1
- package/src/matrix/monitor/ack-config.ts +1 -1
- package/src/matrix/monitor/reaction-events.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@archipelagolab/lobi",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "Lobi - The official A2A (Agent-to-Agent) messaging platform by Lobisland. Built for AI, enabling seamless communication between intelligent agents.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
package/src/account-selection.ts
CHANGED
|
@@ -137,7 +137,7 @@ function hasConfiguredDefaultMatrixAccountSource(params: {
|
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
export function resolveMatrixChannelConfig(cfg: OpenClawConfig): Record<string, unknown> | null {
|
|
140
|
-
return isRecord(cfg.channels?.
|
|
140
|
+
return isRecord(cfg.channels?.lobi) ? cfg.channels.lobi : null;
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
export function findMatrixAccountEntry(
|
package/src/channel.ts
CHANGED
|
@@ -160,7 +160,7 @@ const resolveMatrixDmPolicy = createScopedDmSecurityResolver<ResolvedMatrixAccou
|
|
|
160
160
|
|
|
161
161
|
const collectMatrixSecurityWarnings =
|
|
162
162
|
createAllowlistProviderOpenWarningCollector<ResolvedMatrixAccount>({
|
|
163
|
-
providerConfigPresent: (cfg) => (cfg as CoreConfig).channels?.
|
|
163
|
+
providerConfigPresent: (cfg) => (cfg as CoreConfig).channels?.lobi !== undefined,
|
|
164
164
|
resolveGroupPolicy: (account) => account.config.groupPolicy,
|
|
165
165
|
buildOpenWarning: {
|
|
166
166
|
surface: "Matrix rooms",
|
package/src/doctor-contract.ts
CHANGED
|
@@ -169,7 +169,7 @@ export function normalizeCompatibilityConfig({
|
|
|
169
169
|
cfg: OpenClawConfig;
|
|
170
170
|
}): ChannelDoctorConfigMutation {
|
|
171
171
|
const channels = isRecord(cfg.channels) ? cfg.channels : null;
|
|
172
|
-
const matrix = isRecord(channels?.
|
|
172
|
+
const matrix = isRecord(channels?.lobi) ? channels.lobi : null;
|
|
173
173
|
if (!matrix) {
|
|
174
174
|
return { config: cfg, changes: [] };
|
|
175
175
|
}
|
package/src/doctor.ts
CHANGED
|
@@ -21,21 +21,21 @@ import { isRecord } from "./record-shared.js";
|
|
|
21
21
|
|
|
22
22
|
function hasConfiguredMatrixChannel(cfg: OpenClawConfig): boolean {
|
|
23
23
|
const channels = cfg.channels as Record<string, unknown> | undefined;
|
|
24
|
-
return isRecord(channels?.
|
|
24
|
+
return isRecord(channels?.lobi);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
function hasConfiguredMatrixPluginSurface(cfg: OpenClawConfig): boolean {
|
|
28
28
|
return Boolean(
|
|
29
|
-
cfg.plugins?.installs?.
|
|
30
|
-
cfg.plugins?.entries?.
|
|
31
|
-
cfg.plugins?.allow?.includes("
|
|
32
|
-
cfg.plugins?.deny?.includes("
|
|
29
|
+
cfg.plugins?.installs?.lobi ||
|
|
30
|
+
cfg.plugins?.entries?.lobi ||
|
|
31
|
+
cfg.plugins?.allow?.includes("lobi") ||
|
|
32
|
+
cfg.plugins?.deny?.includes("lobi"),
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
function hasConfiguredMatrixEnv(env: NodeJS.ProcessEnv): boolean {
|
|
37
37
|
return Object.entries(env).some(
|
|
38
|
-
([key, value]) => key.startsWith("
|
|
38
|
+
([key, value]) => key.startsWith("LOBI_") && typeof value === "string" && value.trim(),
|
|
39
39
|
);
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -82,28 +82,28 @@ export function formatMatrixLegacyCryptoPreview(
|
|
|
82
82
|
|
|
83
83
|
export async function collectMatrixInstallPathWarnings(cfg: OpenClawConfig): Promise<string[]> {
|
|
84
84
|
const issue = await detectPluginInstallPathIssue({
|
|
85
|
-
pluginId: "
|
|
86
|
-
install: cfg.plugins?.installs?.
|
|
85
|
+
pluginId: "lobi",
|
|
86
|
+
install: cfg.plugins?.installs?.lobi,
|
|
87
87
|
});
|
|
88
88
|
if (!issue) {
|
|
89
89
|
return [];
|
|
90
90
|
}
|
|
91
91
|
return formatPluginInstallPathIssue({
|
|
92
92
|
issue,
|
|
93
|
-
pluginLabel: "
|
|
94
|
-
defaultInstallCommand: "openclaw plugins install @
|
|
93
|
+
pluginLabel: "Lobi",
|
|
94
|
+
defaultInstallCommand: "openclaw plugins install @archipelagolab/lobi",
|
|
95
95
|
}).map((entry) => `- ${entry}`);
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
export async function cleanStaleMatrixPluginConfig(cfg: OpenClawConfig) {
|
|
99
99
|
const issue = await detectPluginInstallPathIssue({
|
|
100
|
-
pluginId: "
|
|
101
|
-
install: cfg.plugins?.installs?.
|
|
100
|
+
pluginId: "lobi",
|
|
101
|
+
install: cfg.plugins?.installs?.lobi,
|
|
102
102
|
});
|
|
103
103
|
if (!issue || issue.kind !== "missing-path") {
|
|
104
104
|
return { config: cfg, changes: [] };
|
|
105
105
|
}
|
|
106
|
-
const { config, actions } = removePluginFromConfig(cfg, "
|
|
106
|
+
const { config, actions } = removePluginFromConfig(cfg, "lobi");
|
|
107
107
|
const removed: string[] = [];
|
|
108
108
|
if (actions.install) {
|
|
109
109
|
removed.push("install record");
|
|
@@ -123,7 +123,7 @@ export async function cleanStaleMatrixPluginConfig(cfg: OpenClawConfig) {
|
|
|
123
123
|
return {
|
|
124
124
|
config,
|
|
125
125
|
changes: [
|
|
126
|
-
`Removed stale
|
|
126
|
+
`Removed stale Lobi plugin references (${removed.join(", ")}). The previous install path no longer exists: ${issue.path}`,
|
|
127
127
|
],
|
|
128
128
|
};
|
|
129
129
|
}
|
|
@@ -11,7 +11,7 @@ import type { CoreConfig, MatrixAccountConfig, MatrixConfig } from "../types.js"
|
|
|
11
11
|
type MatrixRoomEntries = Record<string, NonNullable<MatrixConfig["groups"]>[string]>;
|
|
12
12
|
|
|
13
13
|
export function resolveMatrixBaseConfig(cfg: CoreConfig): MatrixConfig {
|
|
14
|
-
return cfg.channels?.
|
|
14
|
+
return cfg.channels?.lobi ?? {};
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
function resolveMatrixAccountsMap(cfg: CoreConfig): Readonly<Record<string, MatrixAccountConfig>> {
|
|
@@ -116,7 +116,7 @@ export function resolveMatrixAccountConfig(params: {
|
|
|
116
116
|
const base = resolveMatrixBaseConfig(params.cfg);
|
|
117
117
|
const merged = resolveMergedAccountConfig<MatrixConfig>({
|
|
118
118
|
channelConfig: base,
|
|
119
|
-
accounts: params.cfg.channels?.
|
|
119
|
+
accounts: params.cfg.channels?.lobi?.accounts as
|
|
120
120
|
| Record<string, Partial<MatrixConfig>>
|
|
121
121
|
| undefined,
|
|
122
122
|
accountId,
|
|
@@ -49,7 +49,7 @@ function resolveLegacyStoragePaths(env: NodeJS.ProcessEnv = process.env): {
|
|
|
49
49
|
|
|
50
50
|
function assertLegacyMigrationAccountSelection(params: { accountKey: string }): void {
|
|
51
51
|
const cfg = getMatrixRuntime().config.loadConfig();
|
|
52
|
-
if (!cfg.channels?.
|
|
52
|
+
if (!cfg.channels?.lobi || typeof cfg.channels.lobi !== "object") {
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
55
|
if (requiresExplicitMatrixDefaultAccount(cfg)) {
|
|
@@ -6,7 +6,7 @@ export function shouldStoreMatrixAccountAtTopLevel(cfg: CoreConfig, accountId: s
|
|
|
6
6
|
if (normalizedAccountId !== DEFAULT_ACCOUNT_ID) {
|
|
7
7
|
return false;
|
|
8
8
|
}
|
|
9
|
-
const accounts = cfg.channels?.
|
|
9
|
+
const accounts = cfg.channels?.lobi?.accounts;
|
|
10
10
|
return !accounts || Object.keys(accounts).length === 0;
|
|
11
11
|
}
|
|
12
12
|
|
|
@@ -128,7 +128,7 @@ export function updateMatrixAccountConfig(
|
|
|
128
128
|
accountId: string,
|
|
129
129
|
patch: MatrixAccountPatch,
|
|
130
130
|
): CoreConfig {
|
|
131
|
-
const matrix = cfg.channels?.
|
|
131
|
+
const matrix = cfg.channels?.lobi ?? {};
|
|
132
132
|
const normalizedAccountId = normalizeAccountId(accountId);
|
|
133
133
|
const existingAccount = (findMatrixAccountConfig(cfg, normalizedAccountId) ??
|
|
134
134
|
(normalizedAccountId === DEFAULT_ACCOUNT_ID ? matrix : {})) as MatrixConfig;
|
|
@@ -55,7 +55,7 @@ function resolveLegacyMatrixCredentialsPath(env: NodeJS.ProcessEnv): string {
|
|
|
55
55
|
function shouldReadLegacyCredentialsForAccount(accountId?: string | null): boolean {
|
|
56
56
|
const normalizedAccountId = normalizeAccountId(accountId);
|
|
57
57
|
const cfg = getMatrixRuntime().config.loadConfig();
|
|
58
|
-
if (!cfg.channels?.
|
|
58
|
+
if (!cfg.channels?.lobi || typeof cfg.channels.lobi !== "object") {
|
|
59
59
|
return normalizedAccountId === DEFAULT_ACCOUNT_ID;
|
|
60
60
|
}
|
|
61
61
|
if (requiresExplicitMatrixDefaultAccount(cfg)) {
|
|
@@ -9,7 +9,7 @@ export function resolveMatrixAckReactionConfig(params: {
|
|
|
9
9
|
agentId: string;
|
|
10
10
|
accountId?: string | null;
|
|
11
11
|
}): { ackReaction: string; ackReactionScope: MatrixAckReactionScope } {
|
|
12
|
-
const matrixConfig = params.cfg.channels?.
|
|
12
|
+
const matrixConfig = params.cfg.channels?.lobi;
|
|
13
13
|
const accountConfig = resolveMatrixAccountConfig({
|
|
14
14
|
cfg: params.cfg as CoreConfig,
|
|
15
15
|
accountId: params.accountId,
|
|
@@ -20,7 +20,7 @@ export function resolveMatrixReactionNotificationMode(params: {
|
|
|
20
20
|
cfg: CoreConfig;
|
|
21
21
|
accountId: string;
|
|
22
22
|
}): MatrixReactionNotificationMode {
|
|
23
|
-
const matrixConfig = params.cfg.channels?.
|
|
23
|
+
const matrixConfig = params.cfg.channels?.lobi;
|
|
24
24
|
const accountConfig = resolveMatrixAccountConfig({
|
|
25
25
|
cfg: params.cfg,
|
|
26
26
|
accountId: params.accountId,
|