galaxy-opc-plugin 0.3.0 → 0.3.3

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/index.ts CHANGED
@@ -47,7 +47,6 @@ import { registerOrderTool } from "./src/tools/order-tool.js";
47
47
  import { registerOpcCommand } from "./src/commands/opc-command.js";
48
48
  import { triggerEventRules } from "./src/opc/event-triggers.js";
49
49
  import { registerConfigUi } from "./src/web/config-ui.js";
50
- import { registerLandingPage } from "./src/web/landing-page.js";
51
50
 
52
51
  /** 解析数据库路径,支持 ~ 前缀 */
53
52
  function resolveDbPath(configured?: string): string {
@@ -153,7 +152,6 @@ const plugin = {
153
152
 
154
153
  // 注册 Web UI
155
154
  registerConfigUi(api, db, gatewayToken);
156
- registerLandingPage(api);
157
155
 
158
156
  // ── 智能刷新器(共享函数,after_tool_call + subagent_ended 共用) ──
159
157
  const refreshTimers = new Map<string, ReturnType<typeof setTimeout>>();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "galaxy-opc-plugin",
3
- "version": "0.3.0",
3
+ "version": "0.3.3",
4
4
  "description": "星环 Galaxy OPC — 一人公司孵化与赋能平台 OpenClaw 插件",
5
5
  "keywords": [
6
6
  "openclaw",
@@ -217,7 +217,7 @@ export function registerCompanyRoutes(api: OpenClawPluginApi, db: OpcDatabase, g
217
217
  apiAny.registerHttpRoute({
218
218
  path: "/opc/api/companies",
219
219
  handler,
220
- auth: "gateway",
220
+ auth: "plugin",
221
221
  match: "prefix",
222
222
  });
223
223
  } else {
@@ -128,7 +128,7 @@ export function registerDashboardApiRoutes(api: OpenClawPluginApi, db: OpcDataba
128
128
  apiAny.registerHttpRoute({
129
129
  path: "/opc/admin/api",
130
130
  handler,
131
- auth: "gateway",
131
+ auth: "plugin",
132
132
  match: "prefix",
133
133
  });
134
134
  }
@@ -4162,7 +4162,7 @@ export function registerConfigUi(api: OpenClawPluginApi, db: OpcDatabase, gatewa
4162
4162
  }
4163
4163
 
4164
4164
  // Serve HTML page for all other /opc/admin paths
4165
- sendHtml(res, buildPageHtml(!!gatewayToken));
4165
+ sendHtml(res, buildPageHtml(false));
4166
4166
  return true;
4167
4167
  } catch (err) {
4168
4168
  res.writeHead(500, { "Content-Type": "application/json; charset=utf-8" });
@@ -4182,7 +4182,7 @@ export function registerConfigUi(api: OpenClawPluginApi, db: OpcDatabase, gatewa
4182
4182
  apiAny.registerHttpRoute({
4183
4183
  path: "/opc/admin",
4184
4184
  handler,
4185
- auth: "gateway",
4185
+ auth: "plugin",
4186
4186
  match: "prefix",
4187
4187
  });
4188
4188
  } else {
@@ -321,17 +321,12 @@ export function registerLandingPage(api: OpenClawPluginApi): void {
321
321
  };
322
322
 
323
323
  if (typeof apiAny.registerHttpHandler === "function") {
324
+ // 旧版 openclaw:通过 registerHttpHandler 注册,返回 false 时 openclaw 继续处理聊天 UI
324
325
  apiAny.registerHttpHandler(handler);
325
- } else if (typeof apiAny.registerHttpRoute === "function") {
326
- apiAny.registerHttpRoute({
327
- path: "/",
328
- handler,
329
- auth: "plugin",
330
- match: "prefix",
331
- });
326
+ api.logger.info("opc: 已注册产品官网 (/)");
332
327
  } else {
333
- throw new Error("No compatible HTTP registration API found on OpenClaw plugin API");
328
+ // 新版 openclaw (2026.3.2+):跳过官网注册,保留 openclaw 原生聊天 UI /
329
+ // 用户通过 /opc/admin 直接访问管理后台
330
+ api.logger.info("opc: 跳过官网注册(新版 openclaw,聊天 UI 保留在 /)");
334
331
  }
335
-
336
- api.logger.info("opc: 已注册产品官网 (/)");
337
332
  }