openxiangda-skill-kit 2.0.0-alpha.131 → 2.0.0-alpha.132

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.131",
3
+ "version": "2.0.0-alpha.132",
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.106"
20
+ "openxiangda-devkit-core": "2.0.0-alpha.107"
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 an OpenXiangda 2.0 application, including anonymous public forms and other no-account external-user pages.",
7
- "sha256": "30164c69a712928b1d63bbc79a294820f9b1a330259e0c915dcd8c70c3fb356e"
7
+ "sha256": "ad7e89a4cfeba1b730cdd9504609872e1355bf5d79101c439cdf7350a4bc9678"
8
8
  }
9
9
  ]
10
10
  }
@@ -85,6 +85,19 @@ operation pages under `/admin/operations`; parameterized routes remain
85
85
  reachable but cannot be menu references. `defineAdminContributions` remains an
86
86
  admin-only helper and intentionally rejects `user` routes.
87
87
 
88
+ When a Workflow Surface must link back to an application-owned business record,
89
+ declare `detailRouteCode: { desktop, mobile }` on that resource. Both codes must
90
+ reference explicit `surface: 'user'` routes that require the resource's read
91
+ capability. The desktop path must stay outside `/m`, the mobile path must start
92
+ with `/m/`, and each path must contain exactly one bounded dynamic record
93
+ parameter; its name may follow the application domain, such as
94
+ `:applicationId`. The compiler emits the pair in the resource Contract and in
95
+ `resourceDefinitions`; the platform substitutes the record id from the
96
+ authorized Workflow Surface. Never derive `/<resourceCode>/<recordId>`, add an
97
+ alias, or build the destination in the browser. Omitting the declaration means
98
+ there is no application business-record target; a broken published mapping
99
+ fails closed.
100
+
88
101
  The platform also owns admin appearance. Wrap bespoke admin content in
89
102
  `OpenXiangdaAdminPage`. Ant Design components inherit the existing
90
103
  `ConfigProvider`; do not create another theme provider. Use
@@ -238,8 +251,9 @@ to insert a button.
238
251
 
239
252
  Generated contracts intentionally emit each resource Surface once in
240
253
  `resourceSurfaces`; `resourceDefinitions[code].surface` references that shared
241
- object. Import the generated runtime definitions normally. Do not serialize,
242
- inline or duplicate Surface literals in application code.
254
+ object, while an explicit resource `detailRouteCode` is preserved beside it.
255
+ Import the generated runtime definitions normally. Do not serialize, inline or
256
+ duplicate Surface literals in application code.
243
257
 
244
258
  The standard Workflow detail renderers consume only the authoritative Surface:
245
259
  `presentation.businessDetail`, `presentation.summary`, the typed timeline and
@@ -143,6 +143,31 @@ Use a canonical navigation target with `PLATFORM_ROUTE`, `APP_ROUTE` or allowlis
143
143
 
144
144
  The Notification Hub resolves desktop, mobile and channel deep links. The landing page always re-runs platform authentication and Data/AuthZ/Workflow authorization.
145
145
 
146
+ Business-record navigation and custom Workflow detail are separate contracts.
147
+ To let the standard Workflow page offer “view business detail”, declare an
148
+ explicit route pair on the subject resource:
149
+
150
+ ```ts
151
+ const purchaseResource = {
152
+ code: 'purchases',
153
+ name: '采购申请',
154
+ detailRouteCode: {
155
+ desktop: 'purchase-record-detail',
156
+ mobile: 'purchase-record-detail-mobile',
157
+ },
158
+ fields: [/* ... */],
159
+ } satisfies AppDataResourceDeclaration;
160
+ ```
161
+
162
+ Both routes are authenticated `surface: 'user'` routes, require
163
+ `app:<app-code>:data:<resource-code>:read`, and contain exactly one dynamic
164
+ record parameter. Desktop stays outside `/m`; mobile starts with `/m/`. The
165
+ parameter may be named for the domain (`:purchaseId`, `:applicationId`, and so
166
+ on). The compiler seals the mapping and the platform renders it from the same
167
+ active Contract revision used for Workflow navigation. With no mapping the
168
+ Surface returns no business-record target. It never guesses a path from the
169
+ resource code, and a malformed active mapping fails closed.
170
+
146
171
  To replace the standard Workflow detail page everywhere, declare both route
147
172
  codes on the Workflow definition declaration. The desktop route must be an
148
173
  `admin` route, the mobile route must be a `user` route, and both paths contain
@@ -26,7 +26,7 @@
26
26
  - Application login is optional `frontend.authentication`: existing platform users only, registration rejected, exact desktop `/login` and mobile `/m/login`. Bind generated `authenticationSurfaces` to separate PC/mobile renderers through `defineApplicationContributions`; renderers own only brand visuals and call `ApplicationLoginSurfaceProps`. The platform alone owns passwords, providers, OAuth state/callbacks, secure cookies, current identity and authorization. Never put login in protected `appRoutes`, call a v1 auth route, store tokens, create users/roles, or add another Router/identity provider. Keep QA in generated `platformAuthManifest`, outside the protected route denominator.
27
27
  - Branded standard user pages use the optional exact `standardUserSurfaces` contribution from `openxiangda/react`: provide separate desktop/mobile `frame` and `applicationTodoCenter` renderers or omit the property entirely. The platform still owns `/todos`, `/m/todos`, Workflow routes, `RuntimeBoundary`, current-user Notification Hub data, query/load/interaction callbacks and navigation. Never add a second Router, Todo API client, identity store or token prop.
28
28
  - External users without platform accounts use only an exact static `surface: 'user'` route declared through `frontend.publicAccess`. Declare the one resource, bounded field sets, required operations, draft limits and named duplicate validations; consume only generated `anonymousPublicAccess` and `createAnonymousPublicClient`. `own.list`/`own.read` mean records submitted by the same platform-issued HttpOnly browser credential, not a verified natural person, and another browser or cleared cookie intentionally loses access. Never create a guest role/user, call the general Native Data API, expose an anonymous upload path, store identity locally or derive ownership from IP, user-agent or fingerprint.
29
- - Declare each resource once in `openxiangda.config.ts` with only `code`, `name`, `fields` and optional `mutationOwner`, generated/list/layout/data-policy settings. Each field owns type, label, required state, Surface flags, reference/file metadata and access. Resource codes are lower kebab-case. Use `native` for direct Data API mutations, `action`, `readonly` or `workflow` for non-Native ownership; never grant or generate Native mutation for a non-Native owner.
29
+ - Declare each resource once in `openxiangda.config.ts` with only `code`, `name`, `fields` and optional `mutationOwner`, generated/list/layout/data-policy settings. A Workflow subject resource may additionally declare `detailRouteCode: { desktop, mobile }`; both values reference explicit authenticated user routes that require the resource read capability, use the correct `/m` family and contain exactly one dynamic record parameter. This is the only business-record navigation source: never infer `/<resourceCode>/<recordId>` or add an alias. Each field owns type, label, required state, Surface flags, reference/file metadata and access. Resource codes are lower kebab-case. Use `native` for direct Data API mutations, `action`, `readonly` or `workflow` for non-Native ownership; never grant or generate Native mutation for a non-Native owner.
30
30
  - Never write resource-level `schemaVersion`, `appCode`, `schema`, `surface`, `capabilities`, `fieldPolicies` or `platform/data` modules. The compiler derives the strict DataResource, CRUD capabilities, Surface and AI Schema. The application manifest still starts with its one top-level `schemaVersion: 3`.
31
31
  - Ordinary list/get/create/update/delete, filters, export and batch operations use the platform Native Data API. Do not create Function CRUD or NestJS wrappers.
32
32
  - Add NestJS only for a named business action that needs a cross-resource transaction, an invariant or an external side effect.