@lingyao037/openclaw-lingyao-cli 0.9.0 → 0.9.1
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/{accounts-BNuShH7y.d.ts → accounts-B9ijYIIu.d.ts} +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/index.d.ts +44 -13
- package/dist/index.js +44 -35
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -329,4 +329,4 @@ interface PairingSession {
|
|
|
329
329
|
expiresAt: number;
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
-
export { AccountManager as A, type DeviceInfo as D, type FailedEntry as F, type HealthStatus as H, type LingyaoRuntime as L, type MemorySyncPayload as M, type NotifyPayload as N, type PairingCode as P, type QueuedMessage as Q, type SyncRequest as S, type TokenRefreshRequest as T, type WebSocketConnection as W, type
|
|
332
|
+
export { AccountManager as A, type DeviceInfo as D, type FailedEntry as F, type HealthStatus as H, type LingyaoRuntime as L, type MemorySyncPayload as M, type NotifyPayload as N, type PairingCode as P, type QueuedMessage as Q, type SyncRequest as S, type TokenRefreshRequest as T, type WebSocketConnection as W, type LingyaoAccountConfig as a, type DeviceToken as b, type SyncResponse as c, type LingyaoMessage as d, type LingyaoConfig as e, type AckRequest as f, type DiarySyncPayload as g, LINGYAO_SERVER_URL as h, type LingyaoAccount as i, MessageType as j, type NotifyAction as k, type NotifyRequest as l, type PairingConfirmRequest as m, type PairingConfirmResponse as n, type PollRequest as o, type PollResponse as p, type TokenRefreshResponse as q };
|
package/dist/cli.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,28 @@
|
|
|
1
|
-
import * as openclaw_plugin_sdk_core from 'openclaw/plugin-sdk/core';
|
|
2
1
|
import * as openclaw_plugin_sdk from 'openclaw/plugin-sdk';
|
|
3
|
-
import {
|
|
4
|
-
|
|
2
|
+
import { PluginRuntime, ChannelPlugin } from 'openclaw/plugin-sdk';
|
|
3
|
+
import { a as LingyaoAccountConfig, L as LingyaoRuntime, D as DeviceInfo, b as DeviceToken, A as AccountManager, S as SyncRequest, c as SyncResponse, d as LingyaoMessage, e as LingyaoConfig, N as NotifyPayload, H as HealthStatus } from './accounts-B9ijYIIu.js';
|
|
4
|
+
export { f as AckRequest, g as DiarySyncPayload, F as FailedEntry, h as LINGYAO_SERVER_URL, i as LingyaoAccount, M as MemorySyncPayload, j as MessageType, k as NotifyAction, l as NotifyRequest, P as PairingCode, m as PairingConfirmRequest, n as PairingConfirmResponse, o as PollRequest, p as PollResponse, Q as QueuedMessage, T as TokenRefreshRequest, q as TokenRefreshResponse, W as WebSocketConnection } from './accounts-B9ijYIIu.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Config Adapter - Account resolution, config validation
|
|
8
|
+
*
|
|
9
|
+
* serverUrl is NOT exposed to users — hardcoded as LINGYAO_SERVER_URL.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Resolved account after config resolution.
|
|
14
|
+
*/
|
|
15
|
+
interface ResolvedAccount {
|
|
16
|
+
readonly id: string;
|
|
17
|
+
readonly accountId?: string | null;
|
|
18
|
+
readonly enabled: boolean;
|
|
19
|
+
readonly dmPolicy: 'paired' | 'open' | 'deny';
|
|
20
|
+
readonly allowFrom: string[];
|
|
21
|
+
readonly gatewayId?: string;
|
|
22
|
+
readonly rawConfig: LingyaoAccountConfig;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare function setLingyaoRuntime(runtime: PluginRuntime): void;
|
|
5
26
|
|
|
6
27
|
/**
|
|
7
28
|
* 错误处理模块
|
|
@@ -965,15 +986,8 @@ declare function validateConfig(config: unknown): LingyaoConfig;
|
|
|
965
986
|
*/
|
|
966
987
|
declare function getDefaultConfig(): LingyaoConfig;
|
|
967
988
|
|
|
968
|
-
declare const
|
|
969
|
-
|
|
970
|
-
name: string;
|
|
971
|
-
description: string;
|
|
972
|
-
configSchema: openclaw_plugin_sdk.OpenClawPluginConfigSchema;
|
|
973
|
-
register: NonNullable<openclaw_plugin_sdk_core.OpenClawPluginDefinition["register"]>;
|
|
974
|
-
} & Pick<openclaw_plugin_sdk_core.OpenClawPluginDefinition, "kind">;
|
|
975
|
-
declare const register: (api: openclaw_plugin_sdk.OpenClawPluginApi) => void | Promise<void>;
|
|
976
|
-
|
|
989
|
+
declare const lingyaoPlugin: ChannelPlugin<ResolvedAccount>;
|
|
990
|
+
declare function initializeLingyaoRuntime(runtime: PluginRuntime): void;
|
|
977
991
|
/** @deprecated Use the default export (OpenClaw SDK entry) instead. */
|
|
978
992
|
declare function createPlugin(runtime: LingyaoRuntime, config?: Partial<LingyaoConfig>): Promise<LingyaoChannel>;
|
|
979
993
|
/** @deprecated Use openclaw.plugin.json for plugin metadata. */
|
|
@@ -991,4 +1005,21 @@ declare const pluginMetadata: {
|
|
|
991
1005
|
defaultConfig: LingyaoConfig;
|
|
992
1006
|
};
|
|
993
1007
|
|
|
994
|
-
|
|
1008
|
+
type ChannelRegistrationApi = {
|
|
1009
|
+
registrationMode?: string;
|
|
1010
|
+
runtime?: unknown;
|
|
1011
|
+
registerChannel: (params: {
|
|
1012
|
+
plugin: unknown;
|
|
1013
|
+
}) => void;
|
|
1014
|
+
};
|
|
1015
|
+
declare const entry: {
|
|
1016
|
+
kind: "bundled-channel-entry";
|
|
1017
|
+
id: string;
|
|
1018
|
+
name: string;
|
|
1019
|
+
description: string;
|
|
1020
|
+
register(api: ChannelRegistrationApi): void;
|
|
1021
|
+
loadChannelPlugin: () => openclaw_plugin_sdk.ChannelPlugin<ResolvedAccount>;
|
|
1022
|
+
setChannelRuntime: typeof setLingyaoRuntime;
|
|
1023
|
+
};
|
|
1024
|
+
|
|
1025
|
+
export { type AgentMessage, DeviceInfo, DeviceToken, HealthStatus, LingyaoAccountConfig, LingyaoChannel, LingyaoConfig, LingyaoMessage, LingyaoRuntime, NotifyPayload, SyncRequest, SyncResponse, createPlugin, entry as default, getDefaultConfig, initializeLingyaoRuntime, lingyaoPlugin, pluginMetadata, validateConfig };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
import {
|
|
3
|
-
defineChannelPluginEntry,
|
|
4
|
-
createChatChannelPlugin
|
|
5
|
-
} from "openclaw/plugin-sdk/core";
|
|
1
|
+
// src/api.ts
|
|
2
|
+
import { createChatChannelPlugin } from "openclaw/plugin-sdk/core";
|
|
6
3
|
|
|
7
4
|
// src/runtime.ts
|
|
8
5
|
import { readFileSync, writeFileSync, mkdirSync, existsSync, unlinkSync } from "fs";
|
|
@@ -3458,7 +3455,7 @@ function getDefaultConfig() {
|
|
|
3458
3455
|
};
|
|
3459
3456
|
}
|
|
3460
3457
|
|
|
3461
|
-
// src/
|
|
3458
|
+
// src/api.ts
|
|
3462
3459
|
var orchestrator = null;
|
|
3463
3460
|
function getOrchestrator() {
|
|
3464
3461
|
return orchestrator;
|
|
@@ -3469,7 +3466,6 @@ var messagingAdapter = createMessagingAdapter();
|
|
|
3469
3466
|
var gatewayAdapter = createGatewayAdapter(getOrchestrator);
|
|
3470
3467
|
var directoryAdapter = createDirectoryAdapter(getOrchestrator);
|
|
3471
3468
|
var outboundAdapter = createOutboundAdapter(getOrchestrator);
|
|
3472
|
-
var statusAdapter = null;
|
|
3473
3469
|
var securityOptions = {
|
|
3474
3470
|
dm: {
|
|
3475
3471
|
channelKey: "lingyao",
|
|
@@ -3523,8 +3519,8 @@ var meta = {
|
|
|
3523
3519
|
order: 50,
|
|
3524
3520
|
aliases: ["lingyao", "\u7075\u723B"]
|
|
3525
3521
|
};
|
|
3526
|
-
|
|
3527
|
-
|
|
3522
|
+
var lingyaoPlugin = {
|
|
3523
|
+
...createChatChannelPlugin({
|
|
3528
3524
|
base: {
|
|
3529
3525
|
id: "lingyao",
|
|
3530
3526
|
meta,
|
|
@@ -3535,31 +3531,18 @@ function buildPlugin() {
|
|
|
3535
3531
|
security: securityOptions,
|
|
3536
3532
|
pairing: pairingOptions,
|
|
3537
3533
|
outbound: outboundAdapter
|
|
3538
|
-
})
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3534
|
+
}),
|
|
3535
|
+
gateway: gatewayAdapter,
|
|
3536
|
+
status: void 0,
|
|
3537
|
+
directory: directoryAdapter,
|
|
3538
|
+
messaging: messagingAdapter
|
|
3539
|
+
};
|
|
3540
|
+
function initializeLingyaoRuntime(runtime) {
|
|
3541
|
+
const adapted = adaptPluginRuntime(runtime);
|
|
3542
|
+
setRuntime(adapted);
|
|
3543
|
+
orchestrator = new MultiAccountOrchestrator(adapted);
|
|
3544
|
+
lingyaoPlugin.status = createStatusAdapter(getOrchestrator, adapted);
|
|
3546
3545
|
}
|
|
3547
|
-
var plugin = buildPlugin();
|
|
3548
|
-
var entry = defineChannelPluginEntry({
|
|
3549
|
-
id: "lingyao",
|
|
3550
|
-
name: "Lingyao",
|
|
3551
|
-
description: "Lingyao Channel Plugin - bidirectional sync via lingyao.live server relay",
|
|
3552
|
-
plugin,
|
|
3553
|
-
setRuntime(runtime) {
|
|
3554
|
-
const adapted = adaptPluginRuntime(runtime);
|
|
3555
|
-
setRuntime(adapted);
|
|
3556
|
-
orchestrator = new MultiAccountOrchestrator(adapted);
|
|
3557
|
-
statusAdapter = createStatusAdapter(getOrchestrator, adapted);
|
|
3558
|
-
plugin.status = statusAdapter;
|
|
3559
|
-
}
|
|
3560
|
-
});
|
|
3561
|
-
var register = entry.register;
|
|
3562
|
-
var index_default = entry;
|
|
3563
3546
|
async function createPlugin(runtime, config = {}) {
|
|
3564
3547
|
const fullConfig = { ...getDefaultConfig(), ...config };
|
|
3565
3548
|
const validatedConfig = validateConfig(fullConfig);
|
|
@@ -3569,7 +3552,7 @@ async function createPlugin(runtime, config = {}) {
|
|
|
3569
3552
|
}
|
|
3570
3553
|
var pluginMetadata = {
|
|
3571
3554
|
name: "lingyao",
|
|
3572
|
-
version: "0.
|
|
3555
|
+
version: "0.9.1",
|
|
3573
3556
|
description: "Lingyao Channel Plugin - bidirectional sync via lingyao.live server relay",
|
|
3574
3557
|
type: "channel",
|
|
3575
3558
|
capabilities: {
|
|
@@ -3580,6 +3563,31 @@ var pluginMetadata = {
|
|
|
3580
3563
|
},
|
|
3581
3564
|
defaultConfig: getDefaultConfig()
|
|
3582
3565
|
};
|
|
3566
|
+
|
|
3567
|
+
// src/runtime-api.ts
|
|
3568
|
+
function setLingyaoRuntime(runtime) {
|
|
3569
|
+
initializeLingyaoRuntime(runtime);
|
|
3570
|
+
}
|
|
3571
|
+
|
|
3572
|
+
// src/index.ts
|
|
3573
|
+
var entry = {
|
|
3574
|
+
kind: "bundled-channel-entry",
|
|
3575
|
+
id: "lingyao",
|
|
3576
|
+
name: "Lingyao",
|
|
3577
|
+
description: "Lingyao Channel Plugin - bidirectional sync via lingyao.live server relay",
|
|
3578
|
+
register(api) {
|
|
3579
|
+
if (api.registrationMode === "cli-metadata") {
|
|
3580
|
+
return;
|
|
3581
|
+
}
|
|
3582
|
+
if (api.runtime) {
|
|
3583
|
+
setLingyaoRuntime(api.runtime);
|
|
3584
|
+
}
|
|
3585
|
+
api.registerChannel({ plugin: lingyaoPlugin });
|
|
3586
|
+
},
|
|
3587
|
+
loadChannelPlugin: () => lingyaoPlugin,
|
|
3588
|
+
setChannelRuntime: setLingyaoRuntime
|
|
3589
|
+
};
|
|
3590
|
+
var index_default = entry;
|
|
3583
3591
|
export {
|
|
3584
3592
|
LINGYAO_SERVER_URL,
|
|
3585
3593
|
LingyaoChannel,
|
|
@@ -3587,8 +3595,9 @@ export {
|
|
|
3587
3595
|
createPlugin,
|
|
3588
3596
|
index_default as default,
|
|
3589
3597
|
getDefaultConfig,
|
|
3598
|
+
initializeLingyaoRuntime,
|
|
3599
|
+
lingyaoPlugin,
|
|
3590
3600
|
pluginMetadata,
|
|
3591
|
-
register,
|
|
3592
3601
|
validateConfig
|
|
3593
3602
|
};
|
|
3594
3603
|
//# sourceMappingURL=index.js.map
|