mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-19 03:03:27 +08:00
重构主控编排与运行时预热链路,统一工作区提示词/专家调度协议并补齐 wiki 记忆注入与写回闭环。
同时收敛启动与运维脚本默认行为(含 wiki worker)、更新 Admin 可观测性与相关测试,降低首轮时延并提高运行稳定性。 Made-with: Cursor
This commit is contained in:
parent
4a23b715a2
commit
dbbe3add6a
14438 changed files with 2693620 additions and 2546 deletions
92
openclaw/extensions/zalouser/src/shared.ts
Normal file
92
openclaw/extensions/zalouser/src/shared.ts
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
||||
import {
|
||||
adaptScopedAccountAccessor,
|
||||
createScopedChannelConfigAdapter,
|
||||
} from "openclaw/plugin-sdk/channel-config-helpers";
|
||||
import {
|
||||
listZalouserAccountIds,
|
||||
resolveDefaultZalouserAccountId,
|
||||
resolveZalouserAccountSync,
|
||||
checkZcaAuthenticated,
|
||||
type ResolvedZalouserAccount,
|
||||
} from "./accounts.js";
|
||||
import type { ChannelPlugin } from "./channel-api.js";
|
||||
import { buildChannelConfigSchema, formatAllowFromLowercase } from "./channel-api.js";
|
||||
import { ZalouserConfigSchema } from "./config-schema.js";
|
||||
import { zalouserDoctor } from "./doctor.js";
|
||||
|
||||
export const zalouserMeta = {
|
||||
id: "zalouser",
|
||||
label: "Zalo Personal",
|
||||
selectionLabel: "Zalo (Personal Account)",
|
||||
docsPath: "/channels/zalouser",
|
||||
docsLabel: "zalouser",
|
||||
blurb: "Zalo personal account via QR code login.",
|
||||
aliases: ["zlu"],
|
||||
order: 85,
|
||||
quickstartAllowFrom: false,
|
||||
} satisfies ChannelPlugin<ResolvedZalouserAccount>["meta"];
|
||||
|
||||
const zalouserConfigAdapter = createScopedChannelConfigAdapter<ResolvedZalouserAccount>({
|
||||
sectionKey: "zalouser",
|
||||
listAccountIds: listZalouserAccountIds,
|
||||
resolveAccount: adaptScopedAccountAccessor(resolveZalouserAccountSync),
|
||||
defaultAccountId: resolveDefaultZalouserAccountId,
|
||||
clearBaseFields: [
|
||||
"profile",
|
||||
"name",
|
||||
"dmPolicy",
|
||||
"allowFrom",
|
||||
"historyLimit",
|
||||
"groupAllowFrom",
|
||||
"groupPolicy",
|
||||
"groups",
|
||||
"messagePrefix",
|
||||
],
|
||||
resolveAllowFrom: (account) => account.config.allowFrom,
|
||||
formatAllowFrom: (allowFrom) =>
|
||||
formatAllowFromLowercase({ allowFrom, stripPrefixRe: /^(zalouser|zlu):/i }),
|
||||
});
|
||||
|
||||
export function createZalouserPluginBase(params: {
|
||||
setupWizard: NonNullable<ChannelPlugin<ResolvedZalouserAccount>["setupWizard"]>;
|
||||
setup: NonNullable<ChannelPlugin<ResolvedZalouserAccount>["setup"]>;
|
||||
}): Pick<
|
||||
ChannelPlugin<ResolvedZalouserAccount>,
|
||||
| "id"
|
||||
| "meta"
|
||||
| "setupWizard"
|
||||
| "capabilities"
|
||||
| "doctor"
|
||||
| "reload"
|
||||
| "configSchema"
|
||||
| "config"
|
||||
| "setup"
|
||||
> {
|
||||
return {
|
||||
id: "zalouser",
|
||||
meta: zalouserMeta,
|
||||
setupWizard: params.setupWizard,
|
||||
capabilities: {
|
||||
chatTypes: ["direct", "group"],
|
||||
media: true,
|
||||
reactions: true,
|
||||
threads: false,
|
||||
polls: false,
|
||||
nativeCommands: false,
|
||||
blockStreaming: true,
|
||||
},
|
||||
doctor: zalouserDoctor,
|
||||
reload: { configPrefixes: ["channels.zalouser"] },
|
||||
configSchema: buildChannelConfigSchema(ZalouserConfigSchema),
|
||||
config: {
|
||||
...zalouserConfigAdapter,
|
||||
isConfigured: async (account) => await checkZcaAuthenticated(account.profile),
|
||||
describeAccount: (account) =>
|
||||
describeAccountSnapshot({
|
||||
account,
|
||||
}),
|
||||
},
|
||||
setup: params.setup,
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue