@@ -29,29 +29,32 @@ FunctionContract
2929
3030## 注册信息
3131
32- | 字段 | 作用 | 是否页面 UI |
33- | --- | --- | --- |
34- | ` id ` 、` version ` | 稳定函数身份与变更追踪 | 否 |
35- | ` summary ` 、` description ` 、` tags ` | 函数目录、搜索、诊断 | 否 |
36- | ` input_schema ` 、` output_schema ` | 表单字段、验证、候选列和详情字段 | 否 |
37- | ` resource ` 、` operation ` | 业务资源与动作归属 | 否 |
38- | ` capability ` | ` collection_query/item_query/create/update/delete/action/task/report ` | 否 |
39- | ` execution ` 、` approval ` 、` risk ` 、` permission ` | 调度、审批与治理;审批可与同步/异步组合 | 否 |
40- | 分类、标题、列、动作位置、mapping、页面类型 | PageProposal/PageSpec | 是,不能注册 |
32+ | 字段 | 作用 | 是否页面 UI |
33+ | --------------------------------------------- | --------------------------------------------------------------------- | --------- --- |
34+ | ` id ` 、` version ` | 稳定函数身份与变更追踪 | 否 |
35+ | ` summary ` 、` description ` 、` tags ` | 函数目录、搜索、诊断 | 否 |
36+ | ` inputSchema ` 、` outputSchema ` | 表单字段、验证、候选列和详情字段 | 否 |
37+ | ` resource ` 、` operation ` | 业务资源与动作归属 | 否 |
38+ | ` capability ` | ` collection_query/item_query/create/update/delete/action/task/report ` | 否 |
39+ | ` execution ` 、` approval ` 、` risk ` 、` permission ` | 调度、审批与治理;审批可与同步/异步组合 | 否 |
40+ | 分类、标题、列、动作位置、mapping、页面类型 | PageProposal/PageSpec | 是,不能注册 |
4141
4242示例:
4343
4444``` ts
45- client .registerFunction ({
46- id: ' player.update' ,
47- version: ' 1.0.0' ,
48- resource: ' player' ,
49- operation: ' update' ,
50- capability: ' update' ,
51- risk: ' warning' ,
52- input_schema: PlayerUpdateSchema ,
53- output_schema: PlayerSchema ,
54- }, updatePlayer );
45+ client .registerFunction (
46+ {
47+ id: " player.update" ,
48+ version: " 1.0.0" ,
49+ resource: " player" ,
50+ operation: " update" ,
51+ capability: " update" ,
52+ risk: " warning" ,
53+ inputSchema: PlayerUpdateSchema ,
54+ outputSchema: PlayerSchema ,
55+ },
56+ updatePlayer ,
57+ );
5558```
5659
5760` capability ` 是能力语义,不是 UI:它只说明 ` player.update ` 可以参与玩家资源的更新生命周期,不说明它显示为行按钮、详情弹窗还是独立页。这些由 PageProposal 生成,随后由 Page Studio 确定。
@@ -60,12 +63,12 @@ client.registerFunction({
6063
6164JSON Schema 是自动界面的基础,但不是完整页面定义:
6265
63- | JSON Schema 信息 | 平台可自动生成 |
64- | --- | --- |
66+ | JSON Schema 信息 | 平台可自动生成 |
67+ | ---------------------------------------- | --------------------------------------------------- --- |
6568| 输入字段、required、enum、format、默认值 | SchemaFormRenderer 字段与校验;Modal/Drawer 仅作为容器 |
66- | 输出对象字段 | 详情字段、结果字段候选 |
67- | 输出 collection item schema | ProTable 列候选 |
68- | REST path + method + path parameter | CRUD capability 与 identity 高置信度建议 |
69+ | 输出对象字段 | 详情字段、结果字段候选 |
70+ | 输出 collection item schema | ProTable 列候选 |
71+ | REST path + method + path parameter | CRUD capability 与 identity 高置信度建议 |
6972
7073JSON Schema 不能自行判断:
7174
@@ -95,12 +98,12 @@ POST /players/{playerId}/ban -> action -> 行操作候选
9598
9699### 非 CRUD 函数
97100
98- | 函数 | 默认 Proposal | 直接发布条件 |
99- | --- | --- | --- |
100- | ` mail.send ` | OperationPage | 有可执行 binding、输入表单、风险/权限与导航默认值 |
101- | ` player.ban ` | Resource action 或 OperationPage | identity/context 明确时为资源动作,否则独立操作页 |
102- | ` reward.batchGrant ` | TaskPage | 真实 task 状态、事件和结果语义完整 |
103- | ` analytics.retention ` | ReportPage | dataset、维度、指标和图表/表格语义完整 |
101+ | 函数 | 默认 Proposal | 直接发布条件 |
102+ | --------------------- | -------------------------------- | ---------------------------------------------- --- |
103+ | ` mail.send ` | OperationPage | 有可执行 binding、输入表单、风险/权限与导航默认值 |
104+ | ` player.ban ` | Resource action 或 OperationPage | identity/context 明确时为资源动作,否则独立操作页 |
105+ | ` reward.batchGrant ` | TaskPage | 真实 task 状态、事件和结果语义完整 |
106+ | ` analytics.retention ` | ReportPage | dataset、维度、指标和图表/表格语义完整 |
104107
105108页面质量:
106109
0 commit comments