Files
openclaw/extensions/beam/index.ts
Peter Steinberger c708b41af4 fix(beam): open uploads at canonical catalog URLs (#120927)
* 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
2026-08-09 02:09:01 -07:00

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 }));
},
});