{"id":109,"date":"2026-03-21T22:47:17","date_gmt":"2026-03-21T14:47:17","guid":{"rendered":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/concepts-typebox\/"},"modified":"2026-03-21T23:08:55","modified_gmt":"2026-03-21T15:08:55","slug":"concepts-typebox","status":"publish","type":"post","link":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/concepts-typebox\/","title":{"rendered":"TypeBox"},"content":{"rendered":"<h1>TypeBox<\/h1>\n<h1>TypeBox \u4f5c\u4e3a\u534f\u8bae\u7684\u4e8b\u5b9e\u6765\u6e90<\/h1>\n<p>\u6700\u540e\u66f4\u65b0\uff1a2026-01-10<\/p>\n<p>TypeBox \u662f\u4e00\u4e2a TypeScript \u4f18\u5148\u7684\u6a21\u5f0f\u5e93\u3002\u6211\u4eec\u7528\u5b83\u6765\u5b9a\u4e49 <strong>Gateway \u7f51\u5173 WebSocket \u534f\u8bae<\/strong>\uff08\u63e1\u624b\u3001\u8bf7\u6c42\/\u54cd\u5e94\u3001\u670d\u52a1\u5668\u4e8b\u4ef6\uff09\u3002\u8fd9\u4e9b\u6a21\u5f0f\u9a71\u52a8<strong>\u8fd0\u884c\u65f6\u9a8c\u8bc1<\/strong>\u3001<strong>JSON Schema \u5bfc\u51fa<\/strong>\u548c macOS \u5e94\u7528\u7684 <strong>Swift \u4ee3\u7801\u751f\u6210<\/strong>\u3002\u4e00\u4e2a\u4e8b\u5b9e\u6765\u6e90\uff1b\u5176\u4ed6\u4e00\u5207\u90fd\u662f\u751f\u6210\u7684\u3002<\/p>\n<p>\u5982\u679c\u4f60\u60f3\u4e86\u89e3\u66f4\u9ad8\u5c42\u6b21\u7684\u534f\u8bae\u4e0a\u4e0b\u6587\uff0c\u8bf7\u4ece <a href=\"\/concepts\/architecture\">Gateway \u7f51\u5173\u67b6\u6784<\/a>\u5f00\u59cb\u3002<\/p>\n<h2>\u5fc3\u667a\u6a21\u578b\uff0830 \u79d2\uff09<\/h2>\n<p>\u6bcf\u4e2a Gateway \u7f51\u5173 WS \u6d88\u606f\u90fd\u662f\u4ee5\u4e0b\u4e09\u79cd\u5e27\u4e4b\u4e00\uff1a<\/p>\n<ul>\n<li><strong>Request<\/strong>\uff1a<code>{ type: \"req\", id, method, params }<\/code><\/li>\n<li><strong>Response<\/strong>\uff1a<code>{ type: \"res\", id, ok, payload | error }<\/code><\/li>\n<li><strong>Event<\/strong>\uff1a<code>{ type: \"event\", event, payload, seq?, stateVersion? }<\/code><\/li>\n<\/ul>\n<p>\u7b2c\u4e00\u4e2a\u5e27<strong>\u5fc5\u987b<\/strong>\u662f <code>connect<\/code> \u8bf7\u6c42\u3002\u4e4b\u540e\uff0c\u5ba2\u6237\u7aef\u53ef\u4ee5\u8c03\u7528\u65b9\u6cd5\uff08\u4f8b\u5982 <code>health<\/code>\u3001<code>send<\/code>\u3001<code>chat.send<\/code>\uff09\u5e76\u8ba2\u9605\u4e8b\u4ef6\uff08\u4f8b\u5982 <code>presence<\/code>\u3001<code>tick<\/code>\u3001<code>agent<\/code>\uff09\u3002<\/p>\n<p>\u8fde\u63a5\u6d41\u7a0b\uff08\u6700\u5c0f\uff09\uff1a<\/p>\n<pre><code>Client                    Gateway\n  |---- req:connect --------&gt;|\n  |&lt;---- res:hello-ok --------|\n  |&lt;---- event:tick ----------|\n  |---- req:health ----------&gt;|\n  |&lt;---- res:health ----------|\n<\/code><\/pre>\n<p>\u5e38\u7528\u65b9\u6cd5 + \u4e8b\u4ef6\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>\u7c7b\u522b<\/th>\n<th>\u793a\u4f8b<\/th>\n<th>\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u6838\u5fc3<\/td>\n<td><code>connect<\/code>\u3001<code>health<\/code>\u3001<code>status<\/code><\/td>\n<td><code>connect<\/code> \u5fc5\u987b\u662f\u7b2c\u4e00\u4e2a<\/td>\n<\/tr>\n<tr>\n<td>\u6d88\u606f<\/td>\n<td><code>send<\/code>\u3001<code>poll<\/code>\u3001<code>agent<\/code>\u3001<code>agent.wait<\/code><\/td>\n<td>\u6709\u526f\u4f5c\u7528\u7684\u9700\u8981 <code>idempotencyKey<\/code><\/td>\n<\/tr>\n<tr>\n<td>\u804a\u5929<\/td>\n<td><code>chat.history<\/code>\u3001<code>chat.send<\/code>\u3001<code>chat.abort<\/code>\u3001<code>chat.inject<\/code><\/td>\n<td>WebChat \u4f7f\u7528\u8fd9\u4e9b<\/td>\n<\/tr>\n<tr>\n<td>\u4f1a\u8bdd<\/td>\n<td><code>sessions.list<\/code>\u3001<code>sessions.patch<\/code>\u3001<code>sessions.delete<\/code><\/td>\n<td>\u4f1a\u8bdd\u7ba1\u7406<\/td>\n<\/tr>\n<tr>\n<td>\u8282\u70b9<\/td>\n<td><code>node.list<\/code>\u3001<code>node.invoke<\/code>\u3001<code>node.pair.*<\/code><\/td>\n<td>Gateway \u7f51\u5173 WS + \u8282\u70b9\u64cd\u4f5c<\/td>\n<\/tr>\n<tr>\n<td>\u4e8b\u4ef6<\/td>\n<td><code>tick<\/code>\u3001<code>presence<\/code>\u3001<code>agent<\/code>\u3001<code>chat<\/code>\u3001<code>health<\/code>\u3001<code>shutdown<\/code><\/td>\n<td>\u670d\u52a1\u5668\u63a8\u9001<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6743\u5a01\u5217\u8868\u5728 <code>src\/gateway\/server.ts<\/code>\uff08<code>METHODS<\/code>\u3001<code>EVENTS<\/code>\uff09\u4e2d\u3002<\/p>\n<h2>\u6a21\u5f0f\u6240\u5728\u4f4d\u7f6e<\/h2>\n<ul>\n<li>\u6e90\u7801\uff1a<code>src\/gateway\/protocol\/schema.ts<\/code><\/li>\n<li>\u8fd0\u884c\u65f6\u9a8c\u8bc1\u5668\uff08AJV\uff09\uff1a<code>src\/gateway\/protocol\/index.ts<\/code><\/li>\n<li>\u670d\u52a1\u5668\u63e1\u624b + \u65b9\u6cd5\u5206\u53d1\uff1a<code>src\/gateway\/server.ts<\/code><\/li>\n<li>\u8282\u70b9\u5ba2\u6237\u7aef\uff1a<code>src\/gateway\/client.ts<\/code><\/li>\n<li>\u751f\u6210\u7684 JSON Schema\uff1a<code>dist\/protocol.schema.json<\/code><\/li>\n<li>\u751f\u6210\u7684 Swift \u6a21\u578b\uff1a<code>apps\/macos\/Sources\/OpenClawProtocol\/GatewayModels.swift<\/code><\/li>\n<\/ul>\n<h2>\u5f53\u524d\u6d41\u7a0b<\/h2>\n<ul>\n<li><code>pnpm protocol:gen<\/code><\/li>\n<li>\u5c06 JSON Schema\uff08draft\u201107\uff09\u5199\u5165 <code>dist\/protocol.schema.json<\/code><\/li>\n<li><code>pnpm protocol:gen:swift<\/code><\/li>\n<li>\u751f\u6210 Swift Gateway \u7f51\u5173\u6a21\u578b<\/li>\n<li><code>pnpm protocol:check<\/code><\/li>\n<li>\u8fd0\u884c\u4e24\u4e2a\u751f\u6210\u5668\u5e76\u9a8c\u8bc1\u8f93\u51fa\u5df2\u63d0\u4ea4<\/li>\n<\/ul>\n<h2>\u6a21\u5f0f\u5728\u8fd0\u884c\u65f6\u7684\u4f7f\u7528\u65b9\u5f0f<\/h2>\n<ul>\n<li><strong>\u670d\u52a1\u5668\u7aef<\/strong>\uff1a\u6bcf\u4e2a\u5165\u7ad9\u5e27\u90fd\u7528 AJV \u9a8c\u8bc1\u3002\u63e1\u624b\u4ec5\u63a5\u53d7\u53c2\u6570\u5339\u914d <code>ConnectParams<\/code> \u7684 <code>connect<\/code> \u8bf7\u6c42\u3002<\/li>\n<li><strong>\u5ba2\u6237\u7aef<\/strong>\uff1aJS \u5ba2\u6237\u7aef\u5728\u4f7f\u7528\u4e4b\u524d\u9a8c\u8bc1\u4e8b\u4ef6\u548c\u54cd\u5e94\u5e27\u3002<\/li>\n<li><strong>\u65b9\u6cd5\u8868\u9762<\/strong>\uff1aGateway \u7f51\u5173\u5728 <code>hello-ok<\/code> \u4e2d\u516c\u5e03\u652f\u6301\u7684 <code>methods<\/code> \u548c <code>events<\/code>\u3002<\/li>\n<\/ul>\n<h2>\u793a\u4f8b\u5e27<\/h2>\n<p>Connect\uff08\u7b2c\u4e00\u6761\u6d88\u606f\uff09\uff1a<\/p>\n<p>&#8220;`json  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\n{<br \/>\n  &#8220;type&#8221;: &#8220;req&#8221;,<br \/>\n  &#8220;id&#8221;: &#8220;c1&#8221;,<br \/>\n  &#8220;method&#8221;: &#8220;connect&#8221;,<br \/>\n  &#8220;params&#8221;: {<br \/>\n    &#8220;minProtocol&#8221;: 2,<br \/>\n    &#8220;maxProtocol&#8221;: 2,<br \/>\n    &#8220;client&#8221;: {<br \/>\n      &#8220;id&#8221;: &#8220;openclaw-macos&#8221;,<br \/>\n      &#8220;displayName&#8221;: &#8220;macos&#8221;,<br \/>\n      &#8220;version&#8221;: &#8220;1.0.0&#8221;,<br \/>\n      &#8220;platform&#8221;: &#8220;macos 15.1&#8221;,<br \/>\n      &#8220;mode&#8221;: &#8220;ui&#8221;,<br \/>\n      &#8220;instanceId&#8221;: &#8220;A1B2&#8221;<br \/>\n    }<br \/>\n  }<br \/>\n}<\/p>\n<pre><code>\nHello-ok \u54cd\u5e94\uff1a\n\n```json  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\n{\n  &quot;type&quot;: &quot;res&quot;,\n  &quot;id&quot;: &quot;c1&quot;,\n  &quot;ok&quot;: true,\n  &quot;payload&quot;: {\n    &quot;type&quot;: &quot;hello-ok&quot;,\n    &quot;protocol&quot;: 2,\n    &quot;server&quot;: { &quot;version&quot;: &quot;dev&quot;, &quot;connId&quot;: &quot;ws-1&quot; },\n    &quot;features&quot;: { &quot;methods&quot;: [&quot;health&quot;], &quot;events&quot;: [&quot;tick&quot;] },\n    &quot;snapshot&quot;: {\n      &quot;presence&quot;: [],\n      &quot;health&quot;: {},\n      &quot;stateVersion&quot;: { &quot;presence&quot;: 0, &quot;health&quot;: 0 },\n      &quot;uptimeMs&quot;: 0\n    },\n    &quot;policy&quot;: { &quot;maxPayload&quot;: 1048576, &quot;maxBufferedBytes&quot;: 1048576, &quot;tickIntervalMs&quot;: 30000 }\n  }\n}\n<\/code><\/pre>\n<p>\u8bf7\u6c42 + \u54cd\u5e94\uff1a<\/p>\n<p>&#8220;`json  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\n{ &#8220;type&#8221;: &#8220;req&#8221;, &#8220;id&#8221;: &#8220;r1&#8221;, &#8220;method&#8221;: &#8220;health&#8221; }<\/p>\n<pre><code>\n```json  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\n{ &quot;type&quot;: &quot;res&quot;, &quot;id&quot;: &quot;r1&quot;, &quot;ok&quot;: true, &quot;payload&quot;: { &quot;ok&quot;: true } }\n<\/code><\/pre>\n<p>\u4e8b\u4ef6\uff1a<\/p>\n<p>&#8220;`json  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\n{ &#8220;type&#8221;: &#8220;event&#8221;, &#8220;event&#8221;: &#8220;tick&#8221;, &#8220;payload&#8221;: { &#8220;ts&#8221;: 1730000000 }, &#8220;seq&#8221;: 12 }<\/p>\n<pre><code>\n## \u6700\u5c0f\u5ba2\u6237\u7aef\uff08Node.js\uff09\n\n\u6700\u5c0f\u53ef\u7528\u6d41\u7a0b\uff1aconnect + health\u3002\n\n```ts  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\nimport { WebSocket } from &quot;ws&quot;;\n\nconst ws = new WebSocket(&quot;ws:\/\/127.0.0.1:18789&quot;);\n\nws.on(&quot;open&quot;, () =&gt; {\n  ws.send(\n    JSON.stringify({\n      type: &quot;req&quot;,\n      id: &quot;c1&quot;,\n      method: &quot;connect&quot;,\n      params: {\n        minProtocol: 3,\n        maxProtocol: 3,\n        client: {\n          id: &quot;cli&quot;,\n          displayName: &quot;example&quot;,\n          version: &quot;dev&quot;,\n          platform: &quot;node&quot;,\n          mode: &quot;cli&quot;,\n        },\n      },\n    }),\n  );\n});\n\nws.on(&quot;message&quot;, (data) =&gt; {\n  const msg = JSON.parse(String(data));\n  if (msg.type === &quot;res&quot; &amp;&amp; msg.id === &quot;c1&quot; &amp;&amp; msg.ok) {\n    ws.send(JSON.stringify({ type: &quot;req&quot;, id: &quot;h1&quot;, method: &quot;health&quot; }));\n  }\n  if (msg.type === &quot;res&quot; &amp;&amp; msg.id === &quot;h1&quot;) {\n    console.log(&quot;health:&quot;, msg.payload);\n    ws.close();\n  }\n});\n<\/code><\/pre>\n<h2>\u5b9e\u8df5\u793a\u4f8b\uff1a\u7aef\u5230\u7aef\u6dfb\u52a0\u65b9\u6cd5<\/h2>\n<p>\u793a\u4f8b\uff1a\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684 <code>system.echo<\/code> \u8bf7\u6c42\uff0c\u8fd4\u56de <code>{ ok: true, text }<\/code>\u3002<\/p>\n<ol>\n<li><strong>\u6a21\u5f0f\uff08\u4e8b\u5b9e\u6765\u6e90\uff09<\/strong><\/li>\n<\/ol>\n<p>\u6dfb\u52a0\u5230 <code>src\/gateway\/protocol\/schema.ts<\/code>\uff1a<\/p>\n<p>&#8220;`ts  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\nexport const SystemEchoParamsSchema = Type.Object(<br \/>\n  { text: NonEmptyString },<br \/>\n  { additionalProperties: false },<br \/>\n);<\/p>\n<p>export const SystemEchoResultSchema = Type.Object(<br \/>\n  { ok: Type.Boolean(), text: NonEmptyString },<br \/>\n  { additionalProperties: false },<br \/>\n);<\/p>\n<pre><code>\n\u5c06\u4e24\u8005\u6dfb\u52a0\u5230 `ProtocolSchemas` \u5e76\u5bfc\u51fa\u7c7b\u578b\uff1a\n\n```ts  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\n  SystemEchoParams: SystemEchoParamsSchema,\n  SystemEchoResult: SystemEchoResultSchema,\n<\/code><\/pre>\n<p>&#8220;`ts  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\nexport type SystemEchoParams = Static;<br \/>\nexport type SystemEchoResult = Static;<\/p>\n<pre><code>\n2. **\u9a8c\u8bc1**\n\n\u5728 `src\/gateway\/protocol\/index.ts` \u4e2d\uff0c\u5bfc\u51fa\u4e00\u4e2a AJV \u9a8c\u8bc1\u5668\uff1a\n\n```ts  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\nexport const validateSystemEchoParams = ajv.compile&lt;SystemEchoParams&gt;(SystemEchoParamsSchema);\n<\/code><\/pre>\n<ol start=\"3\">\n<li><strong>\u670d\u52a1\u5668\u884c\u4e3a<\/strong><\/li>\n<\/ol>\n<p>\u5728 <code>src\/gateway\/server-methods\/system.ts<\/code> \u4e2d\u6dfb\u52a0\u5904\u7406\u7a0b\u5e8f\uff1a<\/p>\n<p>&#8220;`ts  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\nexport const systemHandlers: GatewayRequestHandlers = {<br \/>\n  &#8220;system.echo&#8221;: ({ params, respond }) =&gt; {<br \/>\n    const text = String(params.text ?? &#8220;&#8221;);<br \/>\n    respond(true, { ok: true, text });<br \/>\n  },<br \/>\n};<\/p>\n<pre><code>\n\u5728 `src\/gateway\/server-methods.ts` \u4e2d\u6ce8\u518c\uff08\u5df2\u5408\u5e76 `systemHandlers`\uff09\uff0c\u7136\u540e\u5c06 `&quot;system.echo&quot;` \u6dfb\u52a0\u5230 `src\/gateway\/server.ts` \u4e2d\u7684 `METHODS`\u3002\n\n4. **\u91cd\u65b0\u751f\u6210**\n\n```bash  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\npnpm protocol:check\n<\/code><\/pre>\n<ol start=\"5\">\n<li><strong>\u6d4b\u8bd5 + \u6587\u6863<\/strong><\/li>\n<\/ol>\n<p>\u5728 <code>src\/gateway\/server.*.test.ts<\/code> \u4e2d\u6dfb\u52a0\u670d\u52a1\u5668\u6d4b\u8bd5\uff0c\u5e76\u5728\u6587\u6863\u4e2d\u8bb0\u5f55\u8be5\u65b9\u6cd5\u3002<\/p>\n<h2>Swift \u4ee3\u7801\u751f\u6210\u884c\u4e3a<\/h2>\n<p>Swift \u751f\u6210\u5668\u8f93\u51fa\uff1a<\/p>\n<ul>\n<li>\u5e26\u6709 <code>req<\/code>\u3001<code>res<\/code>\u3001<code>event<\/code> \u548c <code>unknown<\/code> \u60c5\u51b5\u7684 <code>GatewayFrame<\/code> \u679a\u4e3e<\/li>\n<li>\u5f3a\u7c7b\u578b\u7684 payload \u7ed3\u6784\u4f53\/\u679a\u4e3e<\/li>\n<li><code>ErrorCode<\/code> \u503c\u548c <code>GATEWAY_PROTOCOL_VERSION<\/code><\/li>\n<\/ul>\n<p>\u672a\u77e5\u7684\u5e27\u7c7b\u578b\u4fdd\u7559\u4e3a\u539f\u59cb payload \u4ee5\u5b9e\u73b0\u5411\u524d\u517c\u5bb9\u3002<\/p>\n<h2>\u7248\u672c\u63a7\u5236 + \u517c\u5bb9\u6027<\/h2>\n<ul>\n<li><code>PROTOCOL_VERSION<\/code> \u5728 <code>src\/gateway\/protocol\/schema.ts<\/code> \u4e2d\u3002<\/li>\n<li>\u5ba2\u6237\u7aef\u53d1\u9001 <code>minProtocol<\/code> + <code>maxProtocol<\/code>\uff1b\u670d\u52a1\u5668\u62d2\u7edd\u4e0d\u5339\u914d\u7684\u3002<\/li>\n<li>Swift \u6a21\u578b\u4fdd\u7559\u672a\u77e5\u5e27\u7c7b\u578b\u4ee5\u907f\u514d\u7834\u574f\u65e7\u5ba2\u6237\u7aef\u3002<\/li>\n<\/ul>\n<h2>\u6a21\u5f0f\u6a21\u5f0f\u548c\u7ea6\u5b9a<\/h2>\n<ul>\n<li>\u5927\u591a\u6570\u5bf9\u8c61\u4f7f\u7528 <code>additionalProperties: false<\/code> \u4ee5\u5b9e\u73b0\u4e25\u683c\u7684 payload\u3002<\/li>\n<li><code>NonEmptyString<\/code> \u662f ID \u548c\u65b9\u6cd5\/\u4e8b\u4ef6\u540d\u79f0\u7684\u9ed8\u8ba4\u503c\u3002<\/li>\n<li>\u9876\u5c42 <code>GatewayFrame<\/code> \u5728 <code>type<\/code> \u4e0a\u4f7f\u7528<strong>\u9274\u522b\u5668<\/strong>\u3002<\/li>\n<li>\u6709\u526f\u4f5c\u7528\u7684\u65b9\u6cd5\u901a\u5e38\u9700\u8981\u5728 params \u4e2d\u5305\u542b <code>idempotencyKey<\/code>\uff08\u793a\u4f8b\uff1a<code>send<\/code>\u3001<code>poll<\/code>\u3001<code>agent<\/code>\u3001<code>chat.send<\/code>\uff09\u3002<\/li>\n<\/ul>\n<h2>\u5b9e\u65f6 schema JSON<\/h2>\n<p>\u751f\u6210\u7684 JSON Schema \u5728\u4ed3\u5e93\u7684 <code>dist\/protocol.schema.json<\/code> \u4e2d\u3002\u53d1\u5e03\u7684\u539f\u59cb\u6587\u4ef6\u901a\u5e38\u53ef\u5728\u4ee5\u4e0b\u4f4d\u7f6e\u83b7\u53d6\uff1a<\/p>\n<ul>\n<li><a href=\"https:\/\/raw.githubusercontent.com\/openclaw\/openclaw\/main\/dist\/protocol.schema.json\">https:\/\/raw.githubusercontent.com\/openclaw\/openclaw\/main\/dist\/protocol.schema.json<\/a><\/li>\n<\/ul>\n<h2>\u5f53\u4f60\u66f4\u6539\u6a21\u5f0f\u65f6<\/h2>\n<ol>\n<li>\u66f4\u65b0 TypeBox \u6a21\u5f0f\u3002<\/li>\n<li>\u8fd0\u884c <code>pnpm protocol:check<\/code>\u3002<\/li>\n<li>\u63d0\u4ea4\u91cd\u65b0\u751f\u6210\u7684 schema + Swift \u6a21\u578b\u3002<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>TypeBox TypeBox \u4f5c\u4e3a\u534f\u8bae\u7684\u4e8b\u5b9e\u6765\u6e90 \u6700\u540e\u66f4\u65b0\uff1a2026-01-10 TypeBox \u662f\u4e00\u4e2a T [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-109","post","type-post","status-publish","format-standard","hentry","category-docs"],"_links":{"self":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/comments?post=109"}],"version-history":[{"count":1,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/109\/revisions"}],"predecessor-version":[{"id":404,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/109\/revisions\/404"}],"wp:attachment":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/media?parent=109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/categories?post=109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/tags?post=109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}