openxiangda-skill-kit 2.0.0-alpha.84 → 2.0.0-alpha.85

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,CAAC,CAAC;IACjB,MAAM,EAAE,kBAAkB,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,sBAAsB,mBAAmB,CAAC;AACvD,wBAAgB,wBAAwB,WAMvC;AAmBD,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAwExF;AAED,wBAAsB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAepF;AAuBD,wBAAsB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,SAAuC,0BAIzG;AAED,wBAAsB,aAAa,CAAC,KAAK,EAAE,kBAAkB;;;;GAoB5D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,CAAC,CAAC;IACjB,MAAM,EAAE,kBAAkB,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,sBAAsB,mBAAmB,CAAC;AACvD,wBAAgB,wBAAwB,WAMvC;AAmCD,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAgGxF;AAED,wBAAsB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAepF;AAuBD,wBAAsB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,SAAuC,0BAIzG;AAED,wBAAsB,aAAa,CAAC,KAAK,EAAE,kBAAkB;;;;GAoB5D"}
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { createHash } from 'node:crypto';
2
2
  import { existsSync } from 'node:fs';
3
3
  import { readdir, readFile, stat, writeFile, } from 'node:fs/promises';
4
4
  import { dirname, relative, resolve } from 'node:path';
5
- import { DEVKIT_COMMANDS } from 'openxiangda-devkit-core';
5
+ import { DEVKIT_COMMANDS, renderDevkitCommandReference, } from 'openxiangda-devkit-core';
6
6
  import { installSkillTransaction } from './internal/skill-installer.js';
7
7
  export const OPENXIANGDA_SKILL_NAME = 'openxiangda-v2';
8
8
  export function resolveDefaultSkillsRoot() {
@@ -18,8 +18,24 @@ const FORBIDDEN_V2_TERMS = [
18
18
  /\bJS_CODE\b/i,
19
19
  /\bresource publish\b/i,
20
20
  /\bworkflow v3\b/i,
21
+ /\bRoleSession\b/i,
22
+ /\bcreate-openxiangda\b/i,
23
+ /\bopenxiangda-(?:admin|compiler|field-kit|testing|user|workflow)\b/i,
21
24
  ];
22
25
  const knownCommandIds = new Set(DEVKIT_COMMANDS.map(command => command.id));
26
+ const REQUIRED_REFERENCES = [
27
+ 'appspec.md',
28
+ 'architecture.md',
29
+ 'backend.md',
30
+ 'commands.md',
31
+ 'data-authz.md',
32
+ 'delivery.md',
33
+ 'discovery.md',
34
+ 'frontend.md',
35
+ 'testing.md',
36
+ 'workflow-events.md',
37
+ 'workspace.md',
38
+ ];
23
39
  export async function validateSkills(skillsRoot) {
24
40
  const skills = await loadSkills(skillsRoot);
25
41
  const knownSkills = new Set(skills.map(skill => skill.name));
@@ -40,39 +56,54 @@ export async function validateSkills(skillsRoot) {
40
56
  if (!skill.description || !/\bUse (when|for)\b/i.test(skill.description)) {
41
57
  add('Description must explain when the skill should be used.');
42
58
  }
43
- if (/\bTODO\b/.test(skill.source))
44
- add('Skill contains unfinished TODO text.');
45
- for (const forbidden of FORBIDDEN_V2_TERMS) {
46
- if (forbidden.test(skill.source))
47
- add(`2.0 skill contains forbidden 1.x term: ${forbidden.source}`);
48
- }
49
- for (const command of extractCommands(skill.source)) {
50
- const commandId = toCommandId(command);
51
- if (!commandId || !knownCommandIds.has(commandId)) {
52
- add(`Unknown 2.0 CLI command reference: openxiangda ${command}`);
59
+ const referencesRoot = resolve(skillsRoot, skill.directory, 'references');
60
+ for (const name of REQUIRED_REFERENCES) {
61
+ const referenceFile = resolve(referencesRoot, name);
62
+ if (!(await isFile(referenceFile))) {
63
+ add(`Missing required nested reference: references/${name}`, referenceFile);
53
64
  }
54
65
  }
55
- for (const linkedSkill of extractSkillMentions(skill.source)) {
56
- if (!knownSkills.has(linkedSkill))
57
- add(`Unknown skill reference: $${linkedSkill}`);
58
- }
59
- for (const reference of extractLocalMarkdownLinks(skill.source)) {
60
- const target = resolve(dirname(skill.file), reference);
61
- if (!(await isFile(target)))
62
- add(`Broken local reference: ${reference}`);
63
- }
64
- const referencesRoot = resolve(skillsRoot, skill.directory, 'references');
65
- if (await isDirectory(referencesRoot)) {
66
- for (const entry of await readdir(referencesRoot, { withFileTypes: true })) {
67
- if (!entry.isFile() || !entry.name.endsWith('.md'))
68
- continue;
69
- const referenceFile = resolve(referencesRoot, entry.name);
70
- const referenceSource = await readFile(referenceFile, 'utf8');
71
- if (/^---\n/.test(referenceSource)) {
72
- add('Nested reference must not declare Skill frontmatter.', referenceFile);
66
+ const markdownFiles = [skill.file, ...(await markdownFilesBelow(referencesRoot))];
67
+ for (const markdownFile of markdownFiles) {
68
+ const source = await readFile(markdownFile, 'utf8');
69
+ if (markdownFile !== skill.file && /^---\n/.test(source)) {
70
+ add('Nested reference must not declare Skill frontmatter.', markdownFile);
71
+ }
72
+ if (/\bTODO\b/.test(source)) {
73
+ add('Skill contains unfinished TODO text.', markdownFile);
74
+ }
75
+ for (const forbidden of FORBIDDEN_V2_TERMS) {
76
+ if (forbidden.test(source)) {
77
+ add(`2.0 skill contains forbidden 1.x term: ${forbidden.source}`, markdownFile);
78
+ }
79
+ }
80
+ for (const linkedSkill of extractSkillMentions(source)) {
81
+ if (!knownSkills.has(linkedSkill)) {
82
+ add(`Unknown skill reference: $${linkedSkill}`, markdownFile);
83
+ }
84
+ }
85
+ for (const command of extractCommands(source)) {
86
+ const commandId = toCommandId(command);
87
+ if (!commandId || !knownCommandIds.has(commandId)) {
88
+ add(`Unknown 2.0 CLI command reference: openxiangda ${command}`, markdownFile);
89
+ }
90
+ }
91
+ for (const reference of extractLocalMarkdownLinks(source)) {
92
+ const target = resolve(dirname(markdownFile), reference);
93
+ if (!(await isFile(target))) {
94
+ add(`Broken local reference: ${reference}`, markdownFile);
73
95
  }
74
96
  }
75
97
  }
98
+ const commandReference = resolve(referencesRoot, 'commands.md');
99
+ if ((await isFile(commandReference)) &&
100
+ (await readFile(commandReference, 'utf8')) !==
101
+ renderDevkitCommandReference({
102
+ title: 'OpenXiangda 2.0 Commands',
103
+ executable: 'pnpm openxiangda',
104
+ })) {
105
+ add('Generated command reference drifted from DEVKIT_COMMANDS.', commandReference);
106
+ }
76
107
  const agentFile = resolve(skillsRoot, skill.directory, 'agents/openai.yaml');
77
108
  if (!(await isFile(agentFile))) {
78
109
  add('Missing agents/openai.yaml.', agentFile);
@@ -181,7 +212,9 @@ function parseFrontmatter(source) {
181
212
  .map(line => [line[1], line[2].replace(/^['"]|['"]$/g, '')]));
182
213
  }
183
214
  function extractCommands(source) {
184
- return [...source.matchAll(/`openxiangda\s+([^`]+)`/g)].map(match => match[1].trim());
215
+ return [
216
+ ...source.matchAll(/\bopenxiangda(?:@[^\s`]+)?\s+([a-z][a-z0-9:-]*(?:\s+[a-z][a-z0-9:-]*)?)/gi),
217
+ ].map(match => match[1].trim().toLowerCase());
185
218
  }
186
219
  function extractSkillMentions(source) {
187
220
  return [...source.matchAll(/\$([a-z0-9-]+)/g)].map(match => match[1]);
@@ -218,6 +251,22 @@ async function isDirectory(path) {
218
251
  return false;
219
252
  }
220
253
  }
254
+ async function markdownFilesBelow(root) {
255
+ if (!(await isDirectory(root)))
256
+ return [];
257
+ const files = [];
258
+ const visit = async (directory) => {
259
+ for (const entry of await readdir(directory, { withFileTypes: true })) {
260
+ const path = resolve(directory, entry.name);
261
+ if (entry.isDirectory())
262
+ await visit(path);
263
+ else if (entry.isFile() && entry.name.endsWith('.md'))
264
+ files.push(path);
265
+ }
266
+ };
267
+ await visit(root);
268
+ return files.sort();
269
+ }
221
270
  async function pathExists(path) {
222
271
  try {
223
272
  await stat(path);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EACL,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,SAAS,GACV,MAAM,kBAAkB,CAAC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AM,KAAK,GAAG,KAAK,EAAE,SAAiB,EAAE,EAAE;QACxC,KAAK,MAAM,KAAK,IAAI,MAAM,OAAO,CAAC,SAAS,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;YACtE,MAAM,IAAI,GAAG,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;YAC5C,IAAI,KAAK,CAAC,WAAW,EAAE;gBAAE,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC;iBACtC,IAAI,KAAK,CAAC,MAAM,EAAE,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;gBAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC,CAAC;IACF,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC;IAClB,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;AACtB,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,IAAY;IACpC,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openxiangda-skill-kit",
3
- "version": "2.0.0-alpha.84",
3
+ "version": "2.0.0-alpha.85",
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.66"
20
+ "openxiangda-devkit-core": "2.0.0-alpha.67"
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": "ed1f6a68bf3c83402e7d98c64e424b2031091924e008167966d3d265d7ff980e"
7
+ "sha256": "4e79de2626b4fe8ec1049cba8354db8447b2d93160957237df8ba6a3d547bc93"
8
8
  }
9
9
  ]
10
10
  }
@@ -22,14 +22,15 @@ pnpm dlx openxiangda@__OPENXIANGDA_VERSION__ skill install --force
22
22
 
23
23
  Use this order:
24
24
 
25
- 1. Read [Discovery](references/discovery.md), turn the request into actors, scenarios, data, permissions, constraints and acceptance evidence, and identify every unresolved choice.
26
- 2. If the workspace contains `appspec/`, the user asks to maintain requirements, or the task changes observable behavior, read [AppSpec](references/appspec.md) and load `pnpm openxiangda spec context --json`. AppSpec is optional and never a release gate; L0 changes create no record.
27
- 3. Read [Architecture](references/architecture.md), assign one owner to each capability and keep ordinary CRUD on platform Data API.
28
- 4. For every resource or permission change, read [Data and authorization](references/data-authz.md) before editing `openxiangda.config.ts`.
29
- 5. Read [Frontend](references/frontend.md) for pages or fields and [Backend actions](references/backend.md) only for a real business action.
30
- 6. When the application explicitly enables standard approval or notifications, read [Workflow and Notification Hub](references/workflow-notification.md). Keep them optional and out of ordinary CRUD.
31
- 7. Run the connected loop with `pnpm openxiangda dev`, then follow [Testing](references/testing.md) and `pnpm openxiangda check`.
32
- 8. Follow [Delivery](references/delivery.md): deploy preproduction first, inspect status/logs, then promote the exact successful version to production.
25
+ 1. Read [Commands](references/commands.md) when selecting a CLI operation. It is generated from the executable registry. `create` owns application binding and initialization, while `check`, `deploy` and `status` expose the current workspace and deployment facts.
26
+ 2. Read [Discovery](references/discovery.md), turn the request into actors, scenarios, data, permissions, constraints and acceptance evidence, and identify every unresolved choice.
27
+ 3. If the workspace contains `appspec/`, the user asks to maintain requirements, or the task changes observable behavior, read [AppSpec](references/appspec.md), load the bounded index with `pnpm openxiangda spec context --json`, then select only the relevant stable ID. AppSpec is optional and never a release gate; L0 changes create no record.
28
+ 4. Read [Architecture](references/architecture.md), assign one owner to each capability and keep ordinary CRUD on platform Data API.
29
+ 5. For every resource or permission change, read [Data and authorization](references/data-authz.md) before editing `openxiangda.config.ts`.
30
+ 6. Read [Frontend](references/frontend.md) for pages or fields and [Backend actions](references/backend.md) only for a real business action.
31
+ 7. When the application explicitly enables standard approval, application events or notifications, read [Workflow, Events and Notification Hub](references/workflow-events.md). Keep them optional and out of ordinary CRUD.
32
+ 8. Run the connected loop with `pnpm openxiangda dev`, then follow [Testing](references/testing.md) and `pnpm openxiangda check`.
33
+ 9. Follow [Delivery](references/delivery.md): deploy preproduction first, inspect status/logs, then promote the exact successful version to production.
33
34
 
34
35
  For an AI-native client, start the workspace protocol through the same pinned executable:
35
36
 
@@ -45,12 +46,13 @@ Read only the references needed for the current change, except the mandatory dis
45
46
 
46
47
  - [Discovery](references/discovery.md)
47
48
  - [AppSpec](references/appspec.md)
49
+ - [Commands](references/commands.md)
48
50
  - [Architecture](references/architecture.md)
49
51
  - [Workspace agent contract](references/workspace.md)
50
52
  - [Backend actions](references/backend.md)
51
53
  - [Data and authorization](references/data-authz.md)
52
54
  - [Frontend](references/frontend.md)
53
- - [Workflow and Notification Hub](references/workflow-notification.md)
55
+ - [Workflow, Events and Notification Hub](references/workflow-events.md)
54
56
  - [Testing](references/testing.md)
55
57
  - [Delivery](references/delivery.md)
56
58
 
@@ -4,15 +4,17 @@ AppSpec 是 OpenXiangda 2.0 应用仓库中的可选业务意图层。它帮助
4
4
  什么、这次改变什么”,但不复制 `openxiangda.config.ts`、编译合同、代码、测试或部署状态,也
5
5
  不是发布门禁。
6
6
 
7
- AppSpec 只使用 2.0 的 `appspec/``openxiangda.appspec/*/v1`。绝不读取、识别、导入或迁移
7
+ AppSpec 只使用 2.0 的 `appspec/`、文档 schema v1 context v2。绝不读取、识别、导入或迁移
8
8
  1.x 的 `openspec/`、SDD、表单、页面、函数和发布材料。
9
9
 
10
10
  ## 何时读取
11
11
 
12
- - 工作区存在 `appspec/` 时,在分析需求或修改行为前运行 `pnpm openxiangda spec context --json`。
13
- - 已知变更或能力 ID 时传 selector,例如 `pnpm openxiangda spec context booking-window --json`。
12
+ - 工作区存在 `appspec/` 时,在分析需求或修改行为前运行 `pnpm openxiangda spec context --json`,先读取
13
+ 有界索引。
14
+ - 从索引选择相关变更、能力、ADR 或历史变更 ID,再运行例如
15
+ `pnpm openxiangda spec context booking-window --json` 读取正文。
14
16
  - AI-native 客户端可读取 `openxiangda://workspace/appspec` 或调用 `appspec_context`。
15
- - 默认只使用当前应用、相关能力、活跃变更和 ADR;历史变更只在追查原因时人工打开。
17
+ - 默认不加载全部正文;历史变更只在追查原因时用稳定 ID 按需读取。
16
18
 
17
19
  ## 何时维护
18
20
 
@@ -34,17 +36,24 @@ pnpm openxiangda spec new booking-window --title "限制可预约时段" --risk
34
36
  --capabilities CAP-BOOKING --resources bookings
35
37
  pnpm openxiangda spec context booking-window --json
36
38
  pnpm openxiangda spec check
37
- pnpm openxiangda spec close booking-window --summary "已通过真实角色验收"
39
+ pnpm openxiangda spec close booking-window --current-spec merged \
40
+ --summary "已通过真实角色验收"
38
41
  ```
39
42
 
40
43
  `spec check` 是用户主动选择的严格检查;普通 `check/dev/deploy` 只给 advisory,不因 AppSpec
41
44
  缺失或不完整而失败。
42
45
 
46
+ 新 ChangeSpec 的 `currentSpec` 固定从 `pending` 开始。关闭前先把长期有效结果合入 `app.md` 或相关
47
+ CapabilitySpec,再由用户确认 `merged`;不改变长期规格时由用户确认 `not-applicable`。AI 可以列出
48
+ 未合入差异,但不能自行选择这两个值。稳定 REQ/AC 未进入当前规格、L2/L3 必需章节为空或保留默认
49
+ 占位内容时,`spec close` 不移动文件。
50
+
43
51
  ## 写作边界
44
52
 
45
53
  - `app.md` 记录长期目标、角色、范围、术语和跨能力约束。
46
54
  - `capabilities/CAP-*.md` 记录当前有效需求,使用稳定 `REQ-*` 和可证伪 `AC-*`。
47
- - `changes/active/*.md` 只记录本次 delta、风险、影响范围与验收;关闭前把仍有效的结论合入能力规格。
55
+ - `changes/active/*.md` 只记录本次 delta、风险、影响范围与验收;关闭前把仍有效的结论合入能力规格,
56
+ 并由用户确认 `currentSpec`。
48
57
  - `decisions/ADR-*.md` 只用于架构显著决定,不为普通小改创建。
49
58
  - 引用真实 2.0 resource/action code,不抄字段定义和权限矩阵的机器事实。
50
59
  - AI 可以创建 `draft`、指出未确认问题和建议更新,不能自行把需求标记为 `confirmed`。
@@ -1,5 +1,8 @@
1
1
  # OpenXiangda 2.0 Backend
2
2
 
3
+ Read [Architecture](architecture.md) and [Data and authorization](data-authz.md)
4
+ before adding a backend. Finish with [Testing](testing.md).
5
+
3
6
  Keep normal record CRUD in the platform Data API. Use `apps/server` only for typed business actions that need server-side logic. For an interactive request, the platform gateway supplies the verified current user, complete application-role union and capabilities. Controllers bind operations and capabilities through `openxiangda/nest`; workers continue to use their explicit application identity.
4
7
 
5
8
  Every interactive business action uses `@OpenXiangdaOperation(operation)`. The
@@ -65,14 +68,28 @@ Do not silence that diagnostic or replace the connected-development compiler.
65
68
 
66
69
  Backend routes are private to the application unless their operation declaration contains an explicit `ai` block. Never infer AI exposure or risk from the HTTP method. A write action declares its touched resources and non-empty side effects, for example:
67
70
 
71
+ Build operation request and response schemas through
72
+ `resourceRecordSchema`, `schemaRef` and `composeAppOperationSchemas` from
73
+ `openxiangda/config`. These helpers project canonical field value protocols
74
+ from the same Resource declaration and prevent repeated user, department,
75
+ resource-reference or managed-file shapes. Do not import a physical toolchain
76
+ package or copy the JSON protocol by hand.
77
+
68
78
  ```ts
69
79
  {
70
80
  code: 'reservation.enroll',
71
81
  method: 'POST',
72
82
  path: '/api/reservations/enroll',
73
83
  capability: 'app:visitor-app:reservation:enroll',
74
- requestSchema: { type: 'object', properties: { visitorName: { type: 'string' } } },
75
- responseSchema: { type: 'object' },
84
+ ...composeAppOperationSchemas({
85
+ request: resourceRecordSchema(visitorReservations, {
86
+ fields: ['visitorName', 'visitDate', 'startTime'],
87
+ }),
88
+ response: schemaRef('ReservationRecord'),
89
+ definitions: {
90
+ ReservationRecord: resourceRecordSchema(visitorReservations),
91
+ },
92
+ }),
76
93
  ai: {
77
94
  name: '预约访客',
78
95
  description: '校验预约规则并创建访客预约',
@@ -0,0 +1,21 @@
1
+ # OpenXiangda 2.0 Commands
2
+
3
+ > Generated from `DEVKIT_COMMANDS`. Do not edit manually.
4
+
5
+ | Command | Risk | Purpose |
6
+ | --- | --- | --- |
7
+ | `pnpm openxiangda create` | deploy | 创建、绑定并初始化应用 |
8
+ | `pnpm openxiangda dev` | write-local | 连接平台测试数据启动本地 Web 与 Nest |
9
+ | `pnpm openxiangda check` | write-local | 生成契约并执行检查、测试和构建 |
10
+ | `pnpm openxiangda accept` | deploy | 按计划准备可选的真实预发验收身份 |
11
+ | `pnpm openxiangda deploy` | deploy | 部署测试环境或显式复用测试版本部署生产 |
12
+ | `pnpm openxiangda status` | read | 查询最近或指定部署状态 |
13
+ | `pnpm openxiangda logs` | read | 查询最近或指定部署日志 |
14
+ | `pnpm openxiangda cancel` | deploy | 幂等取消尚未提交激活的部署 |
15
+ | `pnpm openxiangda retry` | deploy | 显式重试可恢复的失败部署 |
16
+ | `pnpm openxiangda start` | deploy | 从当前不可变版本启动应用环境 |
17
+ | `pnpm openxiangda stop` | deploy | 将应用环境缩容为零并保留数据 |
18
+ | `pnpm openxiangda rollback` | deploy | 回滚测试或生产环境 |
19
+ | `pnpm openxiangda login` | write-local | 通过平台浏览器授权登录 |
20
+ | `pnpm openxiangda skill` | write-local | 安装当前版本的 AI Skill |
21
+ | `pnpm openxiangda spec` | write-local | 维护可选的 AppSpec 需求与变更辅助 |
@@ -1,5 +1,8 @@
1
1
  # OpenXiangda 2.0 Frontend
2
2
 
3
+ Read [Data and authorization](data-authz.md) for every resource or permission
4
+ change and keep the generated [workspace contract](workspace.md) authoritative.
5
+
3
6
  Use the official Vite + React Router + Refine Core + Ant Design template. Import the platform-owned runtime from `openxiangda/react`, field controls from `openxiangda/field-kit` and clients/types from `openxiangda/core`. Do not copy these implementations into application source and do not add per-resource function wrappers.
4
7
 
5
8
  Generated desktop lists already own row selection, atomic batch update/delete,
@@ -15,7 +18,7 @@ order for form fields and removes authorization/debug explanations from the
15
18
  business UI. Do not create application-owned search toolbars, field ordering
16
19
  maps, permission tips or per-resource CRUD pages for these standard behaviors.
17
20
 
18
- Read the current user, complete application-role union and capabilities from the platform runtime authorization endpoint. The standard Shell owns the optional Perspective selector. Use `hasReadCapability` for navigation, list/detail visibility and readable fields; continue to use `hasCapability` for create/update/delete, workflows and custom actions. The standard client sends the selected Perspective automatically, and the server repeats the projection for rows, fields and RLS. Never implement resource-specific frontend filters for it. Strip unauthorized fields from create and update payloads and never treat a disabled input as server authorization. Verify with `pnpm openxiangda check`.
21
+ Read the current user, complete application-role union and capabilities from the platform runtime authorization endpoint. There is no application-selected active role or identity switch. The standard Shell owns the optional Perspective selector. Use `hasReadCapability` for navigation, list/detail visibility and readable fields; continue to use `hasCapability` for create/update/delete, workflows and custom actions. The standard client sends the selected Perspective automatically, and the server repeats the projection for rows, fields and RLS. Never implement resource-specific frontend filters for it. Strip unauthorized fields from create and update payloads and never treat a disabled input as server authorization. Verify with `pnpm openxiangda check`.
19
22
 
20
23
  Use the standard `Shell` unchanged. It owns the authenticated user's display
21
24
  name, account identifier, safe avatar upload, localized application-role names,
@@ -25,6 +28,28 @@ union. Never fetch identity for the header, display role codes, add a second
25
28
  identity selector, or copy Shell and
26
29
  directory-client implementations into application source.
27
30
 
31
+ For a custom admin operation page, declare the route in
32
+ `openxiangda.config.ts`, import the generated `appRoutes`, and bind every route
33
+ key to exactly one local React page with `defineAdminContributions` from
34
+ `openxiangda/react`. Pass the result to `OpenXiangdaApplication`. Do not wrap the
35
+ page in another `Shell`: the runtime registers it in the unified router and the
36
+ same Shell owns its menu entry, title, history and direct-URL capability gate.
37
+ Only `navigation: 'menu'` routes enter the menu; hidden routes retain the same
38
+ `capability` or `access.allOf/anyOf`, including ancestor constraints. Never add
39
+ an application-owned layout, router, menu, identity provider or permission
40
+ store. Keep operation pages under `/admin/operations`; parameterized routes are
41
+ hidden so they cannot become unresolved menu links.
42
+
43
+ For a small business action on a generated resource page, use the typed
44
+ `resources[resourceCode].toolbar`, `.row` or `.detail` slots accepted by
45
+ `defineAdminContributions`. Declare a stable action code, label and
46
+ capability/access expression. The render context contains only the current
47
+ resource, already-authorized record or selection, and a bounded `refresh()`;
48
+ it does not own CRUD, revisions, fields or authorization. Invoke a guarded Nest
49
+ App Operation for cross-resource transactions, invariants or side effects and
50
+ leave ordinary CRUD on the Native Data API. Do not copy a generated page just
51
+ to insert a button.
52
+
28
53
  Generated contracts intentionally emit each resource Surface once in
29
54
  `resourceSurfaces`; `resourceDefinitions[code].surface` references that shared
30
55
  object. Import the generated runtime definitions normally. Do not serialize,
@@ -1,4 +1,7 @@
1
- # Workflow and Notification Hub
1
+ # Workflow, Events and Notification Hub
2
+
3
+ Read [Architecture](architecture.md), [Data and authorization](data-authz.md)
4
+ and [Testing](testing.md) before enabling this optional layer.
2
5
 
3
6
  Use these optional modules only when the application has a real standard approval or cross-channel notification requirement. Ordinary CRUD and application-specific state machines stay on Data API/App API and must not pull Workflow or Notification code into the default template.
4
7
 
@@ -1,8 +1,9 @@
1
1
  # OpenXiangda 2.0 Application Agent Contract
2
2
 
3
3
  - Use only the workspace-pinned CLI: `pnpm openxiangda <command>`. Never invoke a bare global `openxiangda` inside a 2.0 task.
4
- - `appspec/` is the optional OpenXiangda 2.0 business-intent layer. Before changing observable behavior, read `pnpm openxiangda spec context --json`; use no ChangeSpec for L0 work, one short ChangeSpec for L1, and add permission/rollback/concurrency detail only for L2/L3. AppSpec is advisory, never a release gate, and AI must not self-confirm a draft. Never read, import or migrate 1.x `openspec/` or SDD.
4
+ - `appspec/` is the optional OpenXiangda 2.0 business-intent layer. Before changing observable behavior, read the bounded index with `pnpm openxiangda spec context --json`, then select only the relevant stable ID; use no ChangeSpec for L0 work, one short ChangeSpec for L1, and add permission/rollback/concurrency detail only for L2/L3. Before close, the user—not AI—confirms `currentSpec=merged` or `not-applicable`. AppSpec is advisory and never a release gate. Never read, import or migrate 1.x `openspec/` or SDD.
5
5
  - Use Vite, React Router, Refine Core and Ant Design. Do not add Umi, ProComponents or another admin shell.
6
+ - Keep generated admin routes and custom actions inside the platform Shell. Bind generated `appRoutes` to local operation pages with `defineAdminContributions`, and use only its typed `toolbar`, `row` and `detail` resource slots. Do not create another router, menu, layout, identity provider, permission store or copied CRUD page; route/action access uses capability or `allOf`/`anyOf`, while Data/App API authorization remains server-owned.
6
7
  - Declare each resource once in `openxiangda.config.ts` with only `code`, `name`, `fields` and optional 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.
7
8
  - 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`.
8
9
  - 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.
@@ -13,6 +14,7 @@
13
14
  - 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.
14
15
  - Field `type` is semantic, never a hand-authored database type. The supported catalog is exactly `text.short`, `text.long`, `text.rich`, `number.integer`, `number.decimal`, `boolean`, `date`, `time`, `datetime`, `date-range`, `datetime-range`, `option.single`, `option.multiple`, `cascade.single`, `cascade.multiple`, `user.single`, `user.multiple`, `department.single`, `department.multiple`, `resource-ref.single`, `resource-ref.multiple`, `file`, `image`, `signature`, `address`, `location`, `json`, `serial-number`, `uuid` and `subtable`. The compiler alone derives PostgreSQL columns, constraints and indexes.
15
16
  - 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.
17
+ - Build App Operation request/response schemas with `resourceRecordSchema`, `schemaRef`, `composeJsonSchema` and `composeAppOperationSchemas` from `openxiangda/config`. They project the same Resource declaration and canonical field value protocols; never import a physical toolchain package or repeat user, department, resource-reference or managed-file schemas by hand.
16
18
  - 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.
17
19
  - Desktop and mobile pages share values, validation and authorization, but use separate renderers. Options, members and departments store display snapshots; resource references store direct JSON display values; attachments, images and signatures use platform-managed file references.
18
20
  - `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`.