openxiangda-skill-kit 2.0.0-alpha.75 → 2.0.0-alpha.77

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.0.0-alpha.75",
3
+ "version": "2.0.0-alpha.77",
4
4
  "description": "Validation and deterministic packaging for OpenXiangda 2.0 AI skills.",
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.0.0-alpha.57"
20
+ "openxiangda-devkit-core": "2.0.0-alpha.59"
21
21
  },
22
22
  "devDependencies": {
23
23
  "tsx": "4.23.12",
@@ -39,7 +39,7 @@ const visitorReservations = {
39
39
  },
40
40
  {
41
41
  code: 'attachments', type: 'file', label: '附件',
42
- file: { multiple: true, maxCount: 5, maxSizeMb: 20, accept: ['image/*', '.pdf'] },
42
+ file: { maxCount: 5, maxSizeMb: 20, accept: ['image/*', '.pdf'] },
43
43
  },
44
44
  {
45
45
  code: 'internalNote', type: 'text.long', label: '内部备注',
@@ -56,14 +56,16 @@ Put it in `data: { resources: [visitorReservations] }`. Resource CRUD
56
56
  capabilities are derived by `resourceCapabilityCodes`; grant the needed values
57
57
  to roles. Directory-backed roles also require
58
58
  `app:<app-code>:directory:read`. Explicit field `access` capability codes are
59
- also granted only to the intended roles.
59
+ also granted only to the intended roles. They are owned and exported by the
60
+ generated field policy, so do not repeat them in `authz.capabilities`.
61
+ `authz.capabilities` contains only explicit `backend` or `ui` capabilities.
60
62
 
61
63
  `required: true` owns both storage nullability and form validation. A field
62
64
  without `access` inherits the resource read/create/update capability. Each
63
65
  access array is all-of; `false` is explicit deny. The same arrays drive the
64
66
  generated UI and platform field policies.
65
67
 
66
- Field types are semantic, not PostgreSQL storage aliases. Use the catalog in the generated `AGENTS.md`: for example `text.short`, `number.integer`, `user.single`, `department.multiple`, `resource-ref.single`, `file`, `address` and `subtable`. The compiler alone chooses storage columns and constraints. Reference fields store complete labeled snapshots; resource references additionally declare their source and snapshot fields. File limits exist only under `file` and use `maxSizeMb`.
68
+ Field types are semantic, not PostgreSQL storage aliases. Use the catalog in the generated `AGENTS.md`: for example `text.short`, `number.integer`, `user.single`, `department.multiple`, `resource-ref.single`, `file`, `address` and `subtable`. The compiler alone chooses storage columns and constraints. Reference fields store complete labeled snapshots; resource references additionally declare their source and snapshot fields. File limits exist only under `file`; `maxCount` owns the single/multiple bound and `maxSizeMb` owns the per-file size bound. There is no `file.multiple` key.
67
69
 
68
70
  Do not author raw schema or storage words as field types. `string`, `text`,
69
71
  `integer`, `decimal`, `boolean`, `date`, `datetime`, `uuid`, `json` and `file`
@@ -80,7 +82,7 @@ currentUserDataPolicy({
80
82
  code: 'reservation-host',
81
83
  name: '接待人员仅查看本人预约',
82
84
  resourceCode: 'visitor-reservations',
83
- field: 'hostUserId.value',
85
+ field: 'hostUserId',
84
86
  roleCodes: ['reception_staff'],
85
87
  unrestrictedRoleCodes: ['visitor_admin'],
86
88
  })
@@ -88,6 +90,8 @@ currentUserDataPolicy({
88
90
 
89
91
  Put that value in `authz.dataPolicies`, declare both roles, and set the
90
92
  resource `dataPolicyCode` to the same code. Do not invent `operator`, `value`,
91
- `current_user: true`, lowercase match modes, or policy-level `roleCodes`.
93
+ `current_user: true`, lowercase match modes, a dotted value path, or
94
+ policy-level `roleCodes`. The compiler and platform know that `user.*` fields
95
+ compare their stable `value`; `field` remains the declared field root code.
92
96
 
93
97
  Run `pnpm openxiangda check` after every declaration or permission change.