openxiangda-skill-kit 2.3.28 → 2.3.29

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openxiangda-skill-kit",
3
- "version": "2.3.28",
3
+ "version": "2.3.29",
4
4
  "description": "OpenXiangda 2.0 中文 AI 技能的校验、分发与安装。",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -17,7 +17,7 @@
17
17
  "README.md"
18
18
  ],
19
19
  "dependencies": {
20
- "openxiangda-devkit-core": "2.33.0"
20
+ "openxiangda-devkit-core": "2.33.1"
21
21
  },
22
22
  "devDependencies": {
23
23
  "tsx": "4.23.12",
@@ -275,7 +275,9 @@ const enroll = {
275
275
  type: 'object', required: ['location'],
276
276
  properties: { location: { type: 'string' } },
277
277
  },
278
- responseSchema: { type: 'object' },
278
+ responseSchema: { type: 'object', properties: {
279
+ ticketNo: { type: 'string' }, locationName: { type: 'string' },
280
+ } },
279
281
  ai: {
280
282
  name: '发起访客预约', description: '校验访客信息、地点与时间后创建预约',
281
283
  risk: 'write', resources: ['reservations'], sideEffects: ['创建访客预约'],
@@ -285,6 +287,10 @@ const enroll = {
285
287
  aliases: ['发起邀约'],
286
288
  supportOperations: ['reservation.locations'],
287
289
  inputLookups: { location: 'reservation.locations' },
290
+ resultCard: { title: '预约已提交', fields: [
291
+ { path: 'ticketNo', label: '预约单号' },
292
+ { path: 'locationName', label: '地点' },
293
+ ] },
288
294
  },
289
295
  },
290
296
  };
@@ -292,7 +298,9 @@ const enroll = {
292
298
 
293
299
  两个 `capability` 必须在 `authz.capabilities` 中声明为 `kind: 'backend'`,再授予相应角色。`supportOperations` 和 `inputLookups` 引用同一应用中的操作 code;被引用操作必须声明 `visibility: 'support'`、`risk: 'read'` 且使用 GET。`inputLookups` 的键必须存在于任务的 `requestSchema.properties`。示例问法最多 12 条、别名最多 20 条、辅助操作最多 12 个、字段绑定最多 32 个;运行时辅助查询仍应分页、有界,并返回业务标签与稳定引用。
294
300
 
295
- 业务规则必须在后端操作中验证;提示词、卡片预填和前端校验不能取代权限与业务校验。完整输入、缺失输入、同名地点、权限不足、重复提交和结果未知都应有应用测试与回执核对。任务声明随 AppVersion 的 AI Catalog 一起发布,不能另建手工目录。交互卡片与自动执行仅在平台 Agent Host 支持后启用;本声明本身不改变现有 MCP Facade 的写入确认协议。
301
+ `resultCard` 是已完成任务的只读结果卡片:只允许引用 `responseSchema.properties` 中明确声明的顶层字符串、数字或布尔字段,最多 8 项;不渲染任意 HTML/JS。应用须确保这些字段可向当前用户显示。平台助手已支持按应用声明自动执行普通写任务;待补信息表单、自定义 React 卡片 Host 仍按平台批次实现。本声明不改变既有 MCP Facade 的写入确认协议。
302
+
303
+ 业务规则必须在后端操作中验证;提示词、卡片预填和前端校验不能取代权限与业务校验。完整输入、缺失输入、同名地点、权限不足、重复提交和结果未知都应有应用测试与回执核对。任务声明随 AppVersion 的 AI Catalog 一起发布,不能另建手工目录。
296
304
 
297
305
  宿主(平台 AI 网关)用该目录装配 MCP Facade,应用不自己实现协议:
298
306
 
@@ -58,6 +58,7 @@
58
58
  | GET 操作的 `ai.risk` 只能是 `read`;写操作不能是 `read` | `risk: 'read'` ↔ `method: 'GET'` |
59
59
  | 面向普通用户的 Agent 只发现显式声明的业务任务;底层 CRUD 不会自动成为任务 | `ai.agent: { visibility: 'task', examples: ['帮我发起报修'], aliases: ['提交报修'] }` |
60
60
  | 任务输入需要地点、人员等业务选择时,绑定同应用的只读辅助操作,用户不填内部编码 | `agent: { visibility: 'task', supportOperations: ['repair.locations'], inputLookups: { location: 'repair.locations' } }`;被引用的 GET 操作须有 `agent: { visibility: 'support' }`,`location` 须是请求 Schema 字段 |
61
+ | 任务完成后显示业务结果卡片 | `agent.resultCard: { title: '报修已提交', fields: [{ path: 'ticketNo', label: '单号' }] }`;`ticketNo` 必须是该操作响应 Schema 中的顶层标量字段,最多 8 项 |
61
62
  | controller 路由必须绑定 `@OpenXiangdaOperation(appOperations.<code>)`,普通 CRUD 不写 controller | check 门禁会拒绝未绑定路由 |
62
63
  | 事务守卫 `errorCode` 必须匹配 `^OPENXIANGDA_[A-Z0-9_]{1,96}$` | `errorCode: 'OPENXIANGDA_REPAIR_REQUEST_NOT_PENDING'` |
63
64