Skip to content

Commit 1262205

Browse files
committed
fix(protocol): allow config hint documentation URLs
1 parent 0021e51 commit 1262205

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

‎packages/gateway-protocol/src/schema/config.test.ts‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { Value } from "typebox/value";
22
import { describe, expect, it } from "vitest";
3-
import { ConfigSchemaResponseSchema } from "./config.js";
3+
import { ConfigSchemaLookupResultSchema, ConfigSchemaResponseSchema } from "./config.js";
44

55
const response = {
66
schema: {},
77
uiHints: {
88
"channels.sms.fromNumber": {
9+
docsUrl: "https://docs.openclaw.ai/channels/sms",
910
presentation: "phone-number",
1011
},
1112
},
@@ -31,3 +32,16 @@ describe("ConfigSchemaResponseSchema", () => {
3132
).toBe(false);
3233
});
3334
});
35+
36+
describe("ConfigSchemaLookupResultSchema", () => {
37+
it("accepts a documentation URL in the resolved hint", () => {
38+
expect(
39+
Value.Check(ConfigSchemaLookupResultSchema, {
40+
path: "gateway",
41+
schema: { type: "object" },
42+
hint: { docsUrl: "https://docs.openclaw.ai/gateway" },
43+
children: [],
44+
}),
45+
).toBe(true);
46+
});
47+
});

‎packages/gateway-protocol/src/schema/config.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export const UpdateRunParamsSchema = closedObject({
7777
const ConfigUiHintSchema = closedObject({
7878
label: Type.Optional(Type.String()),
7979
help: Type.Optional(Type.String()),
80+
docsUrl: Type.Optional(Type.String()),
8081
tags: Type.Optional(Type.Array(Type.String())),
8182
group: Type.Optional(Type.String()),
8283
order: Type.Optional(Type.Integer()),

0 commit comments

Comments
 (0)