@eyeclaw/eyeclaw 2.2.1 → 2.2.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
@@ -26,7 +26,7 @@ const eyeclawPlugin = {
26
26
  const rawConfig = api.config?.plugins?.entries?.eyeclaw?.config
27
27
  const config: EyeClawConfig = {
28
28
  sdkToken: rawConfig?.sdkToken || '',
29
- botId: rawConfig?.botId || '',
29
+ botId: rawConfig?.botId ? String(rawConfig.botId) : '',
30
30
  serverUrl: rawConfig?.serverUrl || '',
31
31
  }
32
32
 
@@ -8,14 +8,16 @@
8
8
  "description": "SDK token for authentication"
9
9
  },
10
10
  "botId": {
11
- "type": "string",
11
+ "oneOf": [
12
+ { "type": "string" },
13
+ { "type": "number" }
14
+ ],
12
15
  "description": "Bot ID in EyeClaw Rails app"
13
16
  },
14
17
  "serverUrl": {
15
18
  "type": "string",
16
19
  "description": "EyeClaw Rails server URL (e.g., http://localhost:3000)"
17
20
  }
18
- },
19
- "required": ["sdkToken", "botId", "serverUrl"]
21
+ }
20
22
  }
21
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eyeclaw/eyeclaw",
3
- "version": "2.2.1",
3
+ "version": "2.2.3",
4
4
  "description": "EyeClaw plugin for OpenClaw - HTTP SSE streaming + WebSocket client",
5
5
  "type": "module",
6
6
  "main": "./index.ts",
@@ -181,28 +181,24 @@ export function createHttpHandler(api: OpenClawPluginApi, getConfig: () => EyeCl
181
181
  */
182
182
  export const eyeclawConfigSchema = {
183
183
  safeParse: (value: unknown) => {
184
+ // 允许空配置
184
185
  if (!value || typeof value !== 'object') {
185
- return { success: false, errors: ['Expected config object'] }
186
+ return { success: true, data: {} }
186
187
  }
187
- const cfg = value as any
188
- if (!cfg.sdkToken) {
189
- return { success: false, errors: ['sdkToken is required'] }
190
- }
191
- if (!cfg.botId) {
192
- return { success: false, errors: ['botId is required'] }
193
- }
194
- if (!cfg.serverUrl) {
195
- return { success: false, errors: ['serverUrl is required'] }
196
- }
197
- return { success: true, data: cfg }
188
+ return { success: true, data: value }
198
189
  },
199
190
  jsonSchema: {
200
191
  type: 'object',
201
192
  properties: {
202
193
  sdkToken: { type: 'string', description: 'EyeClaw SDK Token' },
203
- botId: { type: 'string', description: 'Bot ID in EyeClaw Rails app' },
194
+ botId: {
195
+ oneOf: [
196
+ { type: 'string' },
197
+ { type: 'number' }
198
+ ],
199
+ description: 'Bot ID in EyeClaw Rails app'
200
+ },
204
201
  serverUrl: { type: 'string', description: 'EyeClaw Rails server URL' },
205
202
  },
206
- required: ['sdkToken', 'botId', 'serverUrl'],
207
203
  },
208
204
  }