mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-15 07:04:01 -06:00
c708b41af4
* fix(beam): emit canonical catalog URLs * fix(beam): type readonly runtime config * fix(gateway): keep minimal metadata startup lazy * chore(plugin-sdk): refresh API baseline
35 lines
1.3 KiB
TypeScript
35 lines
1.3 KiB
TypeScript
import { resolveDefaultAgentId } from "openclaw/plugin-sdk/agent-runtime";
|
|
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
|
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
import { createBeamRequestHandler } from "./src/http.js";
|
|
import { createBeamMirrorService } from "./src/mirror.js";
|
|
import { createBeamSessionCatalog } from "./src/session-catalog.js";
|
|
import { createBeamStore } from "./src/store.js";
|
|
|
|
export default definePluginEntry({
|
|
id: "beam",
|
|
name: "Beam",
|
|
description: "Receive redacted local coding sessions as a read-only catalog",
|
|
register(api) {
|
|
const store = createBeamStore(api.runtime);
|
|
api.registerSessionCatalog(createBeamSessionCatalog(store));
|
|
api.registerHttpRoute({
|
|
path: "/api/v1/beam/sessions",
|
|
auth: "gateway",
|
|
match: "exact",
|
|
handler: createBeamRequestHandler({
|
|
store,
|
|
resolveControlUiTarget: () => {
|
|
const config = api.runtime.config.current();
|
|
return {
|
|
// The resolver only reads; the plugin runtime exposes a DeepReadonly view.
|
|
agentId: resolveDefaultAgentId(config as OpenClawConfig),
|
|
basePath: config.gateway?.controlUi?.basePath,
|
|
};
|
|
},
|
|
}),
|
|
});
|
|
api.registerService(createBeamMirrorService({ runtime: api.runtime }));
|
|
},
|
|
});
|