@archipelagolab/lobi 1.0.16 → 1.0.18
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/cli.ts +36 -36
- package/src/matrix/monitor/index.ts +5 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@archipelagolab/lobi",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
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/cli.ts
CHANGED
|
@@ -87,7 +87,7 @@ function resolveMatrixCliAccountId(accountId?: string): string {
|
|
|
87
87
|
function formatMatrixCliCommand(command: string, accountId?: string): string {
|
|
88
88
|
const normalizedAccountId = normalizeAccountId(accountId);
|
|
89
89
|
const suffix = normalizedAccountId === "default" ? "" : ` --account ${normalizedAccountId}`;
|
|
90
|
-
return `openclaw
|
|
90
|
+
return `openclaw lobi ${command}${suffix}`;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
function printMatrixOwnDevices(
|
|
@@ -175,7 +175,7 @@ async function addMatrixAccount(params: {
|
|
|
175
175
|
const runtime = getMatrixRuntime();
|
|
176
176
|
const cfg = runtime.config.loadConfig() as CoreConfig;
|
|
177
177
|
if (!matrixSetupAdapter.applyAccountConfig) {
|
|
178
|
-
throw new Error("
|
|
178
|
+
throw new Error("Lobi account setup is unavailable.");
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
const input: ChannelSetupInput = {
|
|
@@ -669,29 +669,29 @@ function printVerificationStatus(
|
|
|
669
669
|
|
|
670
670
|
export function registerLobiCli(params: { program: Command }): void {
|
|
671
671
|
const root = params.program
|
|
672
|
-
.command("
|
|
673
|
-
.description("
|
|
674
|
-
.addHelpText("after", () => "\nDocs: https://docs.openclaw.ai/channels/
|
|
672
|
+
.command("lobi")
|
|
673
|
+
.description("Lobi channel utilities")
|
|
674
|
+
.addHelpText("after", () => "\nDocs: https://docs.openclaw.ai/channels/lobi\n");
|
|
675
675
|
|
|
676
|
-
const account = root.command("account").description("Manage
|
|
676
|
+
const account = root.command("account").description("Manage Lobi channel accounts");
|
|
677
677
|
|
|
678
678
|
account
|
|
679
679
|
.command("add")
|
|
680
|
-
.description("Add or update a
|
|
680
|
+
.description("Add or update a Lobi account (wrapper around channel setup)")
|
|
681
681
|
.option("--account <id>", "Account ID (default: normalized --name, else default)")
|
|
682
682
|
.option("--name <name>", "Optional display name for this account")
|
|
683
|
-
.option("--avatar-url <url>", "Optional
|
|
684
|
-
.option("--homeserver <url>", "
|
|
685
|
-
.option("--proxy <url>", "Optional HTTP(S) proxy URL for
|
|
683
|
+
.option("--avatar-url <url>", "Optional Lobi avatar URL (mxc:// or http(s) URL)")
|
|
684
|
+
.option("--homeserver <url>", "Lobi homeserver URL")
|
|
685
|
+
.option("--proxy <url>", "Optional HTTP(S) proxy URL for Lobi requests")
|
|
686
686
|
.option(
|
|
687
687
|
"--allow-private-network",
|
|
688
688
|
"Allow Matrix homeserver traffic to private/internal hosts for this account",
|
|
689
689
|
)
|
|
690
|
-
.option("--user-id <id>", "
|
|
691
|
-
.option("--access-token <token>", "
|
|
692
|
-
.option("--password <password>", "
|
|
693
|
-
.option("--device-name <name>", "
|
|
694
|
-
.option("--initial-sync-limit <n>", "
|
|
690
|
+
.option("--user-id <id>", "Lobi user ID")
|
|
691
|
+
.option("--access-token <token>", "Lobi access token")
|
|
692
|
+
.option("--password <password>", "Lobi password")
|
|
693
|
+
.option("--device-name <name>", "Lobi device display name")
|
|
694
|
+
.option("--initial-sync-limit <n>", "Lobi initial sync limit")
|
|
695
695
|
.option(
|
|
696
696
|
"--use-env",
|
|
697
697
|
"Use MATRIX_* env vars (or MATRIX_<ACCOUNT_ID>_* for non-default accounts)",
|
|
@@ -734,14 +734,14 @@ export function registerLobiCli(params: { program: Command }): void {
|
|
|
734
734
|
useEnv: options.useEnv === true,
|
|
735
735
|
}),
|
|
736
736
|
onText: (result) => {
|
|
737
|
-
console.log(`Saved
|
|
737
|
+
console.log(`Saved Lobi account: ${result.accountId}`);
|
|
738
738
|
console.log(`Config path: ${result.configPath}`);
|
|
739
739
|
console.log(
|
|
740
740
|
`Credentials source: ${result.useEnv ? "MATRIX_* / MATRIX_<ACCOUNT_ID>_* env vars" : "inline config"}`,
|
|
741
741
|
);
|
|
742
742
|
if (result.verificationBootstrap.attempted) {
|
|
743
743
|
if (result.verificationBootstrap.success) {
|
|
744
|
-
console.log("
|
|
744
|
+
console.log("Lobi verification bootstrap: complete");
|
|
745
745
|
printTimestamp(
|
|
746
746
|
"Recovery key created at",
|
|
747
747
|
result.verificationBootstrap.recoveryKeyCreatedAt,
|
|
@@ -751,15 +751,15 @@ export function registerLobiCli(params: { program: Command }): void {
|
|
|
751
751
|
}
|
|
752
752
|
} else {
|
|
753
753
|
console.error(
|
|
754
|
-
`
|
|
754
|
+
`Lobi verification bootstrap warning: ${result.verificationBootstrap.error}`,
|
|
755
755
|
);
|
|
756
756
|
}
|
|
757
757
|
}
|
|
758
758
|
if (result.deviceHealth.error) {
|
|
759
|
-
console.error(`
|
|
759
|
+
console.error(`Lobi device health warning: ${result.deviceHealth.error}`);
|
|
760
760
|
} else if (result.deviceHealth.staleOpenClawDeviceIds.length > 0) {
|
|
761
761
|
console.log(
|
|
762
|
-
`
|
|
762
|
+
`Lobi device hygiene warning: stale OpenClaw devices detected (${result.deviceHealth.staleOpenClawDeviceIds.join(", ")}). Run 'openclaw lobi devices prune-stale --account ${result.accountId}'.`,
|
|
763
763
|
);
|
|
764
764
|
}
|
|
765
765
|
if (result.profile.attempted) {
|
|
@@ -774,7 +774,7 @@ export function registerLobiCli(params: { program: Command }): void {
|
|
|
774
774
|
}
|
|
775
775
|
}
|
|
776
776
|
}
|
|
777
|
-
const bindHint = `openclaw agents bind --agent <id> --bind
|
|
777
|
+
const bindHint = `openclaw agents bind --agent <id> --bind lobi:${result.accountId}`;
|
|
778
778
|
console.log(`Bind this account to an agent: ${bindHint}`);
|
|
779
779
|
},
|
|
780
780
|
errorPrefix: "Account setup failed",
|
|
@@ -782,11 +782,11 @@ export function registerLobiCli(params: { program: Command }): void {
|
|
|
782
782
|
},
|
|
783
783
|
);
|
|
784
784
|
|
|
785
|
-
const profile = root.command("profile").description("Manage
|
|
785
|
+
const profile = root.command("profile").description("Manage Lobi bot profile");
|
|
786
786
|
|
|
787
787
|
profile
|
|
788
788
|
.command("set")
|
|
789
|
-
.description("Update
|
|
789
|
+
.description("Update Lobi profile display name and/or avatar")
|
|
790
790
|
.option("--account <id>", "Account ID (for multi-account setups)")
|
|
791
791
|
.option("--name <name>", "Profile display name")
|
|
792
792
|
.option("--avatar-url <url>", "Profile avatar URL (mxc:// or http(s) URL)")
|
|
@@ -824,12 +824,12 @@ export function registerLobiCli(params: { program: Command }): void {
|
|
|
824
824
|
},
|
|
825
825
|
);
|
|
826
826
|
|
|
827
|
-
const direct = root.command("direct").description("Inspect and repair
|
|
827
|
+
const direct = root.command("direct").description("Inspect and repair Lobi direct-room state");
|
|
828
828
|
|
|
829
829
|
direct
|
|
830
830
|
.command("inspect")
|
|
831
|
-
.description("Inspect direct-room mappings for a
|
|
832
|
-
.requiredOption("--user-id <id>", "Peer
|
|
831
|
+
.description("Inspect direct-room mappings for a Lobi user")
|
|
832
|
+
.requiredOption("--user-id <id>", "Peer Lobi user ID")
|
|
833
833
|
.option("--account <id>", "Account ID (for multi-account setups)")
|
|
834
834
|
.option("--verbose", "Show detailed diagnostics")
|
|
835
835
|
.option("--json", "Output as JSON")
|
|
@@ -854,8 +854,8 @@ export function registerLobiCli(params: { program: Command }): void {
|
|
|
854
854
|
|
|
855
855
|
direct
|
|
856
856
|
.command("repair")
|
|
857
|
-
.description("Repair
|
|
858
|
-
.requiredOption("--user-id <id>", "Peer
|
|
857
|
+
.description("Repair Lobi direct-room mappings for a Lobi user")
|
|
858
|
+
.requiredOption("--user-id <id>", "Peer Lobi user ID")
|
|
859
859
|
.option("--account <id>", "Account ID (for multi-account setups)")
|
|
860
860
|
.option("--verbose", "Show detailed diagnostics")
|
|
861
861
|
.option("--json", "Output as JSON")
|
|
@@ -889,11 +889,11 @@ export function registerLobiCli(params: { program: Command }): void {
|
|
|
889
889
|
},
|
|
890
890
|
);
|
|
891
891
|
|
|
892
|
-
const verify = root.command("verify").description("Device verification for
|
|
892
|
+
const verify = root.command("verify").description("Device verification for Lobi E2EE");
|
|
893
893
|
|
|
894
894
|
verify
|
|
895
895
|
.command("status")
|
|
896
|
-
.description("Check
|
|
896
|
+
.description("Check Lobi device verification status")
|
|
897
897
|
.option("--account <id>", "Account ID (for multi-account setups)")
|
|
898
898
|
.option("--verbose", "Show detailed diagnostics")
|
|
899
899
|
.option("--include-recovery-key", "Include stored recovery key in output")
|
|
@@ -923,11 +923,11 @@ export function registerLobiCli(params: { program: Command }): void {
|
|
|
923
923
|
},
|
|
924
924
|
);
|
|
925
925
|
|
|
926
|
-
const backup = verify.command("backup").description("
|
|
926
|
+
const backup = verify.command("backup").description("Lobi room-key backup health and restore");
|
|
927
927
|
|
|
928
928
|
backup
|
|
929
929
|
.command("status")
|
|
930
|
-
.description("Show
|
|
930
|
+
.description("Show Lobi room-key backup status for this device")
|
|
931
931
|
.option("--account <id>", "Account ID (for multi-account setups)")
|
|
932
932
|
.option("--verbose", "Show detailed diagnostics")
|
|
933
933
|
.option("--json", "Output as JSON")
|
|
@@ -965,7 +965,7 @@ export function registerLobiCli(params: { program: Command }): void {
|
|
|
965
965
|
json: options.json === true,
|
|
966
966
|
run: async () => {
|
|
967
967
|
if (options.yes !== true) {
|
|
968
|
-
throw new Error("Refusing to reset
|
|
968
|
+
throw new Error("Refusing to reset Lobi room-key backup without --yes");
|
|
969
969
|
}
|
|
970
970
|
return await resetMatrixRoomKeyBackup({ accountId });
|
|
971
971
|
},
|
|
@@ -1103,7 +1103,7 @@ export function registerLobiCli(params: { program: Command }): void {
|
|
|
1103
1103
|
|
|
1104
1104
|
verify
|
|
1105
1105
|
.command("device <key>")
|
|
1106
|
-
.description("Verify device using a
|
|
1106
|
+
.description("Verify device using a Lobi recovery key")
|
|
1107
1107
|
.option("--account <id>", "Account ID (for multi-account setups)")
|
|
1108
1108
|
.option("--verbose", "Show detailed diagnostics")
|
|
1109
1109
|
.option("--json", "Output as JSON")
|
|
@@ -1144,11 +1144,11 @@ export function registerLobiCli(params: { program: Command }): void {
|
|
|
1144
1144
|
},
|
|
1145
1145
|
);
|
|
1146
1146
|
|
|
1147
|
-
const devices = root.command("devices").description("Inspect and clean up
|
|
1147
|
+
const devices = root.command("devices").description("Inspect and clean up Lobi devices");
|
|
1148
1148
|
|
|
1149
1149
|
devices
|
|
1150
1150
|
.command("list")
|
|
1151
|
-
.description("List server-side
|
|
1151
|
+
.description("List server-side Lobi devices for this account")
|
|
1152
1152
|
.option("--account <id>", "Account ID (for multi-account setups)")
|
|
1153
1153
|
.option("--verbose", "Show detailed diagnostics")
|
|
1154
1154
|
.option("--json", "Output as JSON")
|
|
@@ -66,7 +66,7 @@ export async function monitorMatrixProvider(opts: MonitorMatrixOpts = {}): Promi
|
|
|
66
66
|
}
|
|
67
67
|
const core = getMatrixRuntime();
|
|
68
68
|
let cfg = core.config.loadConfig() as CoreConfig;
|
|
69
|
-
if (cfg.channels?.["
|
|
69
|
+
if (cfg.channels?.["lobi"]?.enabled === false) {
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
72
|
|
|
@@ -130,9 +130,9 @@ export async function monitorMatrixProvider(opts: MonitorMatrixOpts = {}): Promi
|
|
|
130
130
|
channels: {
|
|
131
131
|
...cfg.channels,
|
|
132
132
|
matrix: {
|
|
133
|
-
...cfg.channels?.["
|
|
133
|
+
...cfg.channels?.["lobi"],
|
|
134
134
|
dm: {
|
|
135
|
-
...cfg.channels?.["
|
|
135
|
+
...cfg.channels?.["lobi"]?.dm,
|
|
136
136
|
allowFrom,
|
|
137
137
|
},
|
|
138
138
|
groupAllowFrom,
|
|
@@ -192,7 +192,7 @@ export async function monitorMatrixProvider(opts: MonitorMatrixOpts = {}): Promi
|
|
|
192
192
|
const defaultGroupPolicy = resolveDefaultGroupPolicy(cfg);
|
|
193
193
|
const { groupPolicy: groupPolicyRaw, providerMissingFallbackApplied } =
|
|
194
194
|
resolveAllowlistProviderRuntimeGroupPolicy({
|
|
195
|
-
providerConfigPresent: cfg.channels?.["
|
|
195
|
+
providerConfigPresent: cfg.channels?.["lobi"] !== undefined,
|
|
196
196
|
groupPolicy: accountConfig.groupPolicy,
|
|
197
197
|
defaultGroupPolicy,
|
|
198
198
|
});
|
|
@@ -222,7 +222,7 @@ export async function monitorMatrixProvider(opts: MonitorMatrixOpts = {}): Promi
|
|
|
222
222
|
const dmPolicyRaw = dmConfig?.policy ?? "pairing";
|
|
223
223
|
const dmPolicy = allowlistOnly && dmPolicyRaw !== "disabled" ? "allowlist" : dmPolicyRaw;
|
|
224
224
|
const dmSessionScope = dmConfig?.sessionScope ?? "per-user";
|
|
225
|
-
const textLimit = core.channel.text.resolveTextChunkLimit(cfg, "
|
|
225
|
+
const textLimit = core.channel.text.resolveTextChunkLimit(cfg, "lobi", effectiveAccountId);
|
|
226
226
|
const globalGroupChatHistoryLimit = (
|
|
227
227
|
cfg.messages as { groupChat?: { historyLimit?: number } } | undefined
|
|
228
228
|
)?.groupChat?.historyLimit;
|