mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
docs: document active memory admin alibaba plugins
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
/**
|
||||
* Doctor migration contract for Active Memory state. It moves legacy per-session
|
||||
* toggle JSON into the plugin state keyed store used by current runtimes.
|
||||
*/
|
||||
import crypto from "node:crypto";
|
||||
import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
@@ -81,6 +85,7 @@ async function archiveLegacySource(params: {
|
||||
}
|
||||
}
|
||||
|
||||
/** State migrations exposed to OpenClaw doctor for Active Memory. */
|
||||
export const stateMigrations: PluginDoctorStateMigration[] = [
|
||||
{
|
||||
id: "active-memory-session-toggles-json-to-plugin-state",
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
/**
|
||||
* Active Memory plugin entry and runtime implementation. It recalls recent
|
||||
* memory context through configured agents and injects bounded context snippets.
|
||||
*/
|
||||
import crypto from "node:crypto";
|
||||
import fsSync from "node:fs";
|
||||
import fs from "node:fs/promises";
|
||||
@@ -2861,6 +2865,7 @@ async function maybeResolveActiveRecall(params: {
|
||||
}
|
||||
}
|
||||
|
||||
/** Plugin entry registering Active Memory hooks, tools, config schema, and doctor cleanup. */
|
||||
export default definePluginEntry({
|
||||
id: "active-memory",
|
||||
name: "Active Memory",
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
/**
|
||||
* Admin HTTP RPC plugin entry. It exposes a trusted gateway-authenticated HTTP
|
||||
* endpoint for the explicit admin method allowlist.
|
||||
*/
|
||||
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
||||
import { handleAdminHttpRpcRequest } from "./src/handler.js";
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
/**
|
||||
* HTTP handler for the Admin RPC endpoint. It validates JSON requests, enforces
|
||||
* the method allowlist, dispatches gateway methods, and maps errors to HTTP.
|
||||
*/
|
||||
import { randomUUID } from "node:crypto";
|
||||
import type { IncomingMessage, ServerResponse } from "node:http";
|
||||
import { dispatchGatewayMethod } from "openclaw/plugin-sdk/gateway-method-runtime";
|
||||
@@ -184,6 +188,7 @@ async function dispatchAdminRpc(request: ParsedRequest): Promise<RpcResponse> {
|
||||
}
|
||||
}
|
||||
|
||||
/** Handle one gateway-authenticated Admin HTTP RPC request. */
|
||||
export async function handleAdminHttpRpcRequest(
|
||||
req: IncomingMessage,
|
||||
res: ServerResponse,
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
/**
|
||||
* Method allowlist for Admin HTTP RPC. Only methods listed here can cross the
|
||||
* trusted operator HTTP surface.
|
||||
*/
|
||||
const ADMIN_HTTP_RPC_ALLOWED_METHOD_GROUPS = {
|
||||
gateway: [
|
||||
"health",
|
||||
@@ -54,10 +58,12 @@ const ADMIN_HTTP_RPC_ALLOWED_METHODS: ReadonlySet<string> = new Set(
|
||||
Object.values(ADMIN_HTTP_RPC_ALLOWED_METHOD_GROUPS).flat(),
|
||||
);
|
||||
|
||||
/** Return whether an admin RPC method is exposed over HTTP. */
|
||||
export function isAdminHttpRpcAllowedMethod(method: string): boolean {
|
||||
return ADMIN_HTTP_RPC_ALLOWED_METHODS.has(method);
|
||||
}
|
||||
|
||||
/** List all admin RPC methods exposed over HTTP. */
|
||||
export function listAdminHttpRpcAllowedMethods(): string[] {
|
||||
return Array.from(ADMIN_HTTP_RPC_ALLOWED_METHODS);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
/**
|
||||
* Alibaba Model Studio plugin entry. Registers the DashScope-backed video
|
||||
* generation provider.
|
||||
*/
|
||||
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
||||
import { buildAlibabaVideoGenerationProvider } from "./video-generation-provider.js";
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
/**
|
||||
* Alibaba Model Studio video provider adapter. It resolves DashScope auth and
|
||||
* HTTP policy before delegating task polling to the shared video helper.
|
||||
*/
|
||||
import { isProviderApiKeyConfigured } from "openclaw/plugin-sdk/provider-auth";
|
||||
import { resolveApiKeyForProvider } from "openclaw/plugin-sdk/provider-auth-runtime";
|
||||
import { resolveProviderHttpRequestConfig } from "openclaw/plugin-sdk/provider-http";
|
||||
@@ -25,6 +29,7 @@ function resolveDashscopeAigcApiBaseUrl(baseUrl: string): string {
|
||||
return baseUrl.replace(/\/+$/u, "");
|
||||
}
|
||||
|
||||
/** Build the Alibaba/DashScope video generation provider descriptor. */
|
||||
export function buildAlibabaVideoGenerationProvider(): VideoGenerationProvider {
|
||||
return {
|
||||
id: "alibaba",
|
||||
|
||||
Reference in New Issue
Block a user