openxiangda-skill-kit 2.0.0-alpha.65 → 2.0.0-alpha.66

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.65",
3
+ "version": "2.0.0-alpha.66",
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.47"
20
+ "openxiangda-devkit-core": "2.0.0-alpha.48"
21
21
  },
22
22
  "devDependencies": {
23
23
  "tsx": "4.23.12",
@@ -5,9 +5,9 @@ description: Use when building, inspecting, validating, or delivering a complete
5
5
 
6
6
  # OpenXiangda 2.0
7
7
 
8
- Use the generated React, NestJS and Data API workspace as one application. Before a workspace exists, invoke the exact 2.0 package published with this Skill: `pnpm dlx openxiangda-cli@2.0.0-alpha.80`. Inside an application use only its locked CLI through `pnpm openxiangda`; never invoke a bare global `openxiangda`, because that executable may belong to 1.x.
8
+ Use the generated React, NestJS and Data API workspace as one application. Before a workspace exists, invoke the exact 2.0 package published with this Skill: `pnpm dlx openxiangda-cli@2.0.0-alpha.81`. Inside an application use only its locked CLI through `pnpm openxiangda`; never invoke a bare global `openxiangda`, because that executable may belong to 1.x.
9
9
 
10
- Start with `pnpm dlx openxiangda-cli@2.0.0-alpha.80 login`, then `pnpm dlx openxiangda-cli@2.0.0-alpha.80 create <directory>`. Run `pnpm openxiangda dev` for the local feedback loop and `pnpm openxiangda check` before delivery. Moving tags such as `latest` and `alpha` are forbidden for bootstrap because package-manager metadata and dlx caches can resolve an older toolchain.
10
+ Start with `pnpm dlx openxiangda-cli@2.0.0-alpha.81 login`, then `pnpm dlx openxiangda-cli@2.0.0-alpha.81 create <directory>`. Run `pnpm openxiangda dev` for the local feedback loop and `pnpm openxiangda check` before delivery. Moving tags such as `latest` and `alpha` are forbidden for bootstrap because package-manager metadata and dlx caches can resolve an older toolchain.
11
11
 
12
12
  For an AI-native development client, start the workspace MCP through the same
13
13
  pinned executable with `pnpm exec openxiangda --mcp-stdio --cwd <workspace>`.
@@ -53,6 +53,12 @@ Backend routes are private to the application unless their operation declaration
53
53
  }
54
54
  ```
55
55
 
56
+ Every custom operation capability is declared once in
57
+ `authz.capabilities` with `kind: 'backend'`, then referenced by the operation
58
+ and granted to every role allowed to call it. A capability string written only
59
+ on an operation or role is invalid. Resource CRUD capabilities remain generated
60
+ and must not be copied into this catalog.
61
+
56
62
  Generated CRUD and custom actions use the same platform Catalog, current-user authorization, Preview/Confirm boundary and idempotent execution path. Do not create an application-owned MCP server, preview store, AI role or database client.
57
63
 
58
64
  For visitor duplicates, meeting-time conflicts, and course capacity, use
@@ -62,6 +68,33 @@ calculate replacement counters in application code. Course selection is a
62
68
  locked `record-assert` plus a bounded `increment`; replay must reach the
63
69
  platform idempotency receipt even after the course becomes full.
64
70
 
71
+ The visitor helper has one exact command shape. `duplicateMatch` is the actual
72
+ field-to-submitted-value object used for equality matching; it is never a list
73
+ of field names:
74
+
75
+ ```ts
76
+ return this.operations.createVisitorReservation({
77
+ reservationResourceCode: 'visitor-reservations',
78
+ duplicateMatch: {
79
+ visitorIdentityNumber: body.visitorIdentityNumber,
80
+ visitDate: body.visitDate,
81
+ startTime: body.startTime,
82
+ },
83
+ data: {
84
+ visitorIdentityNumber: body.visitorIdentityNumber,
85
+ visitDate: body.visitDate,
86
+ startTime: body.startTime,
87
+ status: body.status,
88
+ },
89
+ idempotencyKey: body.idempotencyKey,
90
+ activeStatusField: 'status',
91
+ activeStatusValues: ['pending', 'approved'],
92
+ });
93
+ ```
94
+
95
+ Use only declared field codes in `duplicateMatch`. Its values and `data` come
96
+ from the same immutable request body.
97
+
65
98
  An idempotency key and the complete command payload are one immutable pair.
66
99
  Never put `new Date()`, `Date.now()`, `randomUUID()` or another changing value
67
100
  inside a controller while constructing the transaction. If a business time is
@@ -63,6 +63,11 @@ without `access` inherits the resource read/create/update capability. Each
63
63
  access array is all-of; `false` is explicit deny. The same arrays drive the
64
64
  generated UI and platform field policies.
65
65
 
66
+ The complete storage type set is `string`, `text`, `integer`, `decimal`,
67
+ `boolean`, `date`, `datetime`, `uuid`, `json` and `file`. Use `integer` for
68
+ whole numbers and `decimal` for other numeric values; `number` is not a field
69
+ type. `openxiangda check` reports an invalid type at the authored field path.
70
+
66
71
  A single directory user reference uses `type: 'string'`; a single department
67
72
  or same-app resource reference uses `uuid`; any `reference.multiple: true` uses
68
73
  `json`. A resource reference also declares `resourceCode` and a string/text
@@ -9,6 +9,9 @@
9
9
  - A NestJS backend declares only `enabled`, `isolation: 'shared' | 'dedicated'` and `resourceProfile: 'light' | 'standard'`. Never put raw Kubernetes resources, replicas, ports or environment maps in application metadata; the platform owns capacity and scaling.
10
10
  - Use the current logged-in user and the union of application roles. Do not select RoleSession, persist platform Token or implement a second authorization path.
11
11
  - Fields inherit the resource read/create/update capabilities. Use field `access` only to tighten them; arrays are all-of and `false` is explicit deny. There is no `write` fallback.
12
+ - Field storage types are exactly `string`, `text`, `integer`, `decimal`, `boolean`, `date`, `datetime`, `uuid`, `json` and `file`; there is no `number` type.
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
+ - 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.
12
15
  - Desktop and mobile pages share values, validation and authorization, but use separate renderers. Members, departments, resources and attachments use platform-owned selectors and stable IDs.
13
16
  - A single directory user reference uses a `string` field; a single department or same-app resource reference uses `uuid`; every `multiple: true` reference uses `json`. Roles that consume directory-backed fields explicitly include `app:<app-code>:directory:read`.
14
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.