openxiangda-skill-kit 2.0.0-alpha.120 → 2.0.0-alpha.123

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.120",
3
+ "version": "2.0.0-alpha.123",
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.98"
20
+ "openxiangda-devkit-core": "2.0.0-alpha.101"
21
21
  },
22
22
  "devDependencies": {
23
23
  "tsx": "4.23.12",
@@ -30,8 +30,7 @@ directory-client implementations into application source.
30
30
 
31
31
  The application owns the editable admin information architecture through the
32
32
  typed `defineAdminNavigation`, `adminNavigationGroup`, `adminResourcePage`,
33
- `adminOperationPage`, `adminWorkflowWorkCenterPage` and
34
- `adminWorkflowLaunchPage` helpers in `openxiangda/config`. The compiler emits
33
+ and `adminOperationPage` helpers in `openxiangda/config`. The compiler emits
35
34
  all reachable `adminPages`, but the Shell renders only pages explicitly
36
35
  referenced by generated `adminNavigation`, then applies current-user access as
37
36
  a final filter. Page existence, route reachability and menu visibility are
@@ -55,6 +54,14 @@ any explicit or platform-generated route, including dynamic routes that differ
55
54
  only by parameter name. Do not add aliases, redirects or route-order branches
56
55
  for earlier alpha paths.
57
56
 
57
+ Declare the application-wide admin boundary at `frontend.admin.access` with
58
+ `allOf` and/or `anyOf` capability arrays. Import generated `adminAccess` and
59
+ pass it to `OpenXiangdaApplication`; the runtime evaluates that same immutable
60
+ expression before `/admin/**`, `/m/admin/**`, the Shell, generated resources or
61
+ admin contribution pages mount. Portal shortcuts may use the exported pure
62
+ `isAdminAccessAllowed` predicate, while Data/App/Workflow APIs remain the
63
+ server-side authority.
64
+
58
65
  Declare custom routes in `openxiangda.config.ts`, import the generated
59
66
  `appRoutes`, and bind every route key to exactly one local React page with
60
67
  `defineApplicationContributions` from `openxiangda/react`. Pass the result to
@@ -134,10 +141,9 @@ or mobile layout, but it must not add a nested router/Shell or copy generated
134
141
  routes. Route parameters continue to come from React Router, and generated
135
142
  capability plus ancestor access guards run before the component renders.
136
143
 
137
- To expose the standard application-level todo center, add
138
- `adminApplicationTodoCenterPage()` to an explicit admin navigation group. The
139
- compiler generates `/admin/todos`; the same runtime exposes the independent
140
- mobile `/m/todos` page. The page reads only the authenticated user's
144
+ To expose the standard application-level todo center, declare
145
+ `frontend.user.applicationTodoCenter: true`. The compiler generates `/todos`;
146
+ the same runtime exposes the independent mobile `/m/todos` page. The page reads only the authenticated user's
141
147
  Notification Hub recipient projection and deep-links to the platform-resolved
142
148
  target. Do not query Notification Hub management endpoints or recreate a local
143
149
  message state store.
@@ -147,9 +153,8 @@ single desktop/mobile paired catalog for standard Workflow and Todo pages. Each
147
153
  entry carries stable route codes, path parameters, access metadata and a
148
154
  `requiresAuthentication: true` marker; the top-level digest binds the complete
149
155
  catalog. Pass it directly to `OpenXiangdaApplication`. The runtime validates
150
- pair surfaces, parameter names and shared access metadata before registering
151
- the Router/Shell, and projects desktop `adminPages` from this same catalog.
152
- Applications must not recreate standard `/admin/todos`, `/m/todos`, or
156
+ user Surface pairs, parameter names and shared access metadata before registering
157
+ the Router. Applications must not recreate standard `/todos`, `/m/todos`, or
153
158
  Workflow paths, add aliases/redirects, or maintain a second route state. The
154
159
  compiler/platform preflight is the digest authority; the browser validates the
155
160
  digest shape and fails closed on malformed or inconsistent entries.
@@ -29,16 +29,53 @@ business/data/version tuple and `factDigest`.
29
29
  Every definition declares a launch mode: `standalone` for a self-contained
30
30
  generated durable-process page, `custom-page` for an application operation page,
31
31
  `hidden-handoff` for a non-menu handoff route, or `work-center-only` when users
32
- only act on existing tasks. Only `standalone` may be referenced by
33
- `adminWorkflowLaunchPage`; the generated browser runtime uses the workflow's
34
- localized definition title, so applications do not maintain code-to-title
35
- maps. `standalone` and `hidden-handoff` receive a compiler-owned
36
- `processOperationCode` and subject declaration. The browser submits the
37
- platform standard process commit and persists only `commandId` in the URL; it
38
- never owns a save callback, facts/dataRef, preparation token, or direct start.
39
- Custom pages launch only inside a verified Named Action through
32
+ only act on existing tasks. `standalone` exposes the standard user launch
33
+ route, while `hidden-handoff` keeps the same route out of portal navigation;
34
+ the generated browser runtime uses the workflow's localized definition title,
35
+ so applications do not maintain code-to-title maps. `standalone` and
36
+ `hidden-handoff` default to a compiler-owned
37
+ `processOperationCode` and standard process commit. When the subject mutation is
38
+ owned by an App Operation, declare `launch.submission.kind: 'named-operation'`
39
+ instead. The compiler seals its POST path, capability, schemas, input sources,
40
+ result paths and optional context prefill; the standard page invokes that exact
41
+ operation and persists only a returned `commandId`. Missing/null
42
+ `processCommand` is an explicit successful no-approval result. The browser never
43
+ owns a save callback, facts/dataRef, preparation token, or direct start. Custom
44
+ pages launch only inside a verified Named Action through
40
45
  `OpenXiangdaBusinessProcessService`.
41
46
 
47
+ ```ts
48
+ launch: {
49
+ mode: 'hidden-handoff',
50
+ submission: {
51
+ kind: 'named-operation',
52
+ create: {
53
+ operationCode: 'reservation.submit',
54
+ inputs: {
55
+ idempotencyKey: { source: 'idempotency-key' },
56
+ applicant: { source: 'current-user-reference' },
57
+ venue: { source: 'field', fieldCode: 'venue' },
58
+ startAt: { source: 'field', fieldCode: 'startAt' },
59
+ purpose: { source: 'field', fieldCode: 'purpose' },
60
+ },
61
+ output: {
62
+ subjectId: 'id',
63
+ subjectRevision: 'revision',
64
+ processCommand: 'processCommand',
65
+ },
66
+ },
67
+ context: [{ queryParameter: 'venueId', fieldCode: 'venue' }],
68
+ },
69
+ }
70
+ ```
71
+
72
+ Every required operation request property must have one input binding. Use
73
+ `field`, `idempotency-key`, `current-user-reference`, `requested-at`, and—for an
74
+ `existing` intent—both `subject-id` and `subject-revision`. Context parameters
75
+ only prefill declared fields; the Named Action still derives identity, validates
76
+ authorization/business invariants and owns idempotency. Its
77
+ `platformAccess.workflow.codes` must include this workflow.
78
+
42
79
  Use an assignee Provider only when resolution depends on application data. The Provider returns stable Native user/role subjects and never makes the final task authorization decision.
43
80
 
44
81
  The standard operations are approve, reject, return, resubmit, transfer, delegate, add-sign, withdraw, admin reassign, admin terminate and reminder. Render only operations returned by the task/instance Surface. A template or application action cannot add a Workflow command that is absent from the Surface.
@@ -179,7 +216,7 @@ stable snapshot and use a friendly placeholder instead of exposing userId.
179
216
  The standard desktop task and instance pages use `/tasks/:taskId` and
180
217
  `/workflows/:instanceId` as standalone full-screen routes outside the admin
181
218
  Shell. Historical `/admin/tasks/:taskId` and `/admin/workflows/:instanceId`
182
- routes only replace-redirect while preserving query/hash. Mobile remains the
219
+ routes have no alias or redirect. Mobile remains the
183
220
  independent `/m/tasks/:taskId` and `/m/workflows/:instanceId` surface.
184
221
 
185
222
  Files, rich-text images and signatures on this page use only the Workflow
@@ -188,17 +225,18 @@ principal, authorized instance, projected resource/record/field and managed
188
225
  file id. Never substitute the ordinary Data API file route or put credentials
189
226
  in a file URL.
190
227
 
191
- Standard launch entry is also a platform Surface. Desktop uses
192
- `/admin/workflows/:workflowCode/new` and mobile uses
228
+ Standard launch entry is also a platform user Surface. Desktop uses
229
+ `/workflows/:workflowCode/start` and mobile uses
193
230
  `/m/workflows/:workflowCode/start`; both first load
194
231
  `loadWorkflowLaunchSurface(workflowCode)`, verify its compiler-owned subject and
195
- process operation, then use the standard durable process commit.
232
+ submission contract, then use the standard durable process commit or the exact
233
+ sealed Named Action.
196
234
  `custom-page` and `work-center-only` declarations do not expose the standard
197
235
  launch Surface. After start, navigate through the device's standard instance
198
236
  entry so the current `detailRouteCode` contract can redirect consistently.
199
237
 
200
- An application-level inbox is enabled in explicit admin navigation with
201
- `adminApplicationTodoCenterPage()`. It projects Notification Hub messages and
238
+ An application-level inbox is enabled with
239
+ `frontend.user.applicationTodoCenter: true`. It projects Notification Hub messages and
202
240
  per-recipient interaction for the current logged-in user only; it is not the
203
241
  Notification Hub management console. Use its `去处理` navigation to enter the
204
242
  authorized Workflow or application page, and keep approve/reject/transfer
@@ -42,6 +42,6 @@
42
42
  - `option.*`, `user.*`, `department.*` and `resource-ref.*` values never collapse to scalar IDs. Single values store one labeled object and multiple values store object arrays. `resource-ref.*` JSON is not a foreign key, trusted target snapshot or automatically refreshed copy; current target state is read by `resourceCode` plus `value`. 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`.
43
43
  - Derive role grants with `resourceCapabilityCodes(appCode, resourceCode)`. Declare current-user rows only with `currentUserDataPolicy(...)`; do not invent operators, values or alternate current-user spellings.
44
44
  - 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.
45
- - Standard Workflow and Notification Hub are optional 2.0 modules. Enable them only through canonical `openxiangda.config.ts` declarations and generated clients. `standalone`/`hidden-handoff` use the compiler-owned process operation and Durable Business Process Command; never add a browser save callback or call Workflow prepare/start directly. Custom pages launch only through a verified Named Action using `OpenXiangdaBusinessProcessService`. PC and mobile render the same `ProcessCommandSurface` independently and recover only by `commandId`. To replace Workflow detail, declare both desktop and mobile `detailRouteCode` values whose routes contain exactly `:instanceId`. Add the current-user todo page only with `adminApplicationTodoCenterPage()`; never query Notification Hub management APIs from a user page.
45
+ - Standard Workflow and Notification Hub are optional 2.0 modules. Enable them only through canonical `openxiangda.config.ts` declarations and generated clients. `standalone`/`hidden-handoff` default to the compiler-owned process operation; action-owned submission must instead declare `launch.submission.kind: 'named-operation'` with sealed create/existing input and output bindings so the standard PC/mobile page calls the original Named Action and accepts an explicit no-Workflow result. Never add a browser save callback or call Workflow prepare/start directly. Custom pages launch only through a verified Named Action using `OpenXiangdaBusinessProcessService`. PC and mobile render the same `ProcessCommandSurface` independently and recover only by `commandId`. To replace Workflow detail, declare both desktop and mobile `detailRouteCode` values whose routes contain exactly `:instanceId`. Add the current-user todo page only with `frontend.user.applicationTodoCenter: true`; never query Notification Hub management APIs from a user page.
46
46
  - Run `pnpm openxiangda check --json` after contract changes and read `data.sealedArtifact`; check never seals, and an older `.openxiangda/build/app-package.json` is not the current check result. Use `pnpm openxiangda accept --plan <file>` only for optional real preproduction identity acceptance; it never blocks delivery. Deploy with `pnpm openxiangda deploy`, inspect with `pnpm openxiangda status` and `pnpm openxiangda logs`, and use the platform rollback command rather than mutating K3s directly.
47
47
  - AI-native clients start the workspace protocol through the same pinned binary: `pnpm exec openxiangda --mcp-stdio --cwd <workspace>`. Read `openxiangda://workspace/contracts` or call `contract_describe`; for first-time menu authoring, copy `data.adminNavigationAuthoring.suggestion.expression` once into `frontend.admin.navigation` with its listed `openxiangda/config` imports, then edit that application-owned declaration. Never treat the proposal as runtime discovery. When AppSpec is enabled, also read `openxiangda://workspace/appspec` or call `appspec_context`. Require `aiCatalog` and `aiCatalogDigest` to match the normal compiler output. This is a stdio transport mode, not another application-owned server. Never write an application MCP server, Catalog file, preview store or second authorization path.