openxiangda-skill-kit 2.0.0-alpha.76 → 2.0.0-alpha.78

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.76",
3
+ "version": "2.0.0-alpha.78",
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.58"
20
+ "openxiangda-devkit-core": "2.0.0-alpha.60"
21
21
  },
22
22
  "devDependencies": {
23
23
  "tsx": "4.23.12",
@@ -4,7 +4,7 @@
4
4
  {
5
5
  "name": "openxiangda-v2",
6
6
  "description": "Use when researching, designing, building, testing, or delivering a complete OpenXiangda 2.0 application.",
7
- "sha256": "9b26c564ae1fe3dcf1c194d8a64ea43951b0f06dea4dc2da4ffefb5eb0a14e81"
7
+ "sha256": "5545fe41b6afa06ee11eda13eeb372a4baf0ea448224a681d044952db743dd82"
8
8
  }
9
9
  ]
10
10
  }
@@ -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. A resource source `labelField` must point to `text.short` or `text.long`; a `serial-number` field can be listed in `searchFields`, `descriptionFields` or `snapshotFields`, but it is not a display label. 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.
@@ -13,7 +13,7 @@
13
13
  - Declare every custom operation capability in `authz.capabilities` with `kind: 'backend'`, then reference that same code from the operation and its allowed roles. Generated resource CRUD capabilities do not go in this catalog.
14
14
  - Visitor duplicate protection uses `createVisitorReservation({ duplicateMatch: { fieldCode: submittedValue }, ... })`. `duplicateMatch` is a non-empty value map, never a field-name array, and no mutable pre-read is allowed.
15
15
  - Desktop and mobile pages share values, validation and authorization, but use separate renderers. Options, members, departments and resource references store their complete display snapshots; attachments, images and signatures use platform-managed file references.
16
- - `option.*`, `user.*`, `department.*` and `resource-ref.*` values never collapse to scalar IDs. Single values store one labeled snapshot and multiple values store snapshot arrays. `location` accepts only exact WGS84 coordinates captured by DingTalk or browser geolocation; it has no manual input or `manual` source. Roles that consume directory-backed fields explicitly include `app:<app-code>:directory:read`.
16
+ - `option.*`, `user.*`, `department.*` and `resource-ref.*` values never collapse to scalar IDs. Single values store one labeled snapshot and multiple values store snapshot arrays. A resource source `labelField` must be `text.short` or `text.long`; `serial-number` is allowed in source search, description and snapshot fields, but not as the label. `location` accepts only exact WGS84 coordinates captured by DingTalk or browser geolocation; it has no manual input or `manual` source. Roles that consume directory-backed fields explicitly include `app:<app-code>:directory:read`.
17
17
  - Derive role grants with `resourceCapabilityCodes(appCode, resourceCode)`. Declare current-user rows only with `currentUserDataPolicy(...)`; do not invent operators, values or alternate current-user spellings.
18
18
  - Do not add compatibility aliases, migration branches or silent fallbacks for an earlier 2.0 alpha contract. Replace an incorrect contract and regenerate the application.
19
19
  - Standard Workflow and Notification Hub are optional 2.0 modules. Enable them only through the canonical `openxiangda.config.ts` declarations and generated clients; never copy 1.x workflow/message code, tables, APIs, templates or callbacks into this workspace. Keep ordinary CRUD and application-specific state machines independent of them.