openxiangda 1.0.265 → 1.0.267

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.
Files changed (37) hide show
  1. package/README.md +15 -6
  2. package/lib/application-environments.js +15 -1
  3. package/lib/cli.js +57 -8
  4. package/lib/skills.js +59 -56
  5. package/openxiangda-skills/SKILL.md +2 -2
  6. package/openxiangda-skills/skills/openxiangda-core/SKILL.md +1 -1
  7. package/package.json +1 -2
  8. package/packages/sdk/dist/{ProcessPreview-DSUIJi5V.d.mts → ProcessPreview-Cyk6uv-w.d.mts} +3 -2
  9. package/packages/sdk/dist/{ProcessPreview-DSUIJi5V.d.ts → ProcessPreview-Cyk6uv-w.d.ts} +3 -2
  10. package/packages/sdk/dist/components/index.d.mts +42 -41
  11. package/packages/sdk/dist/components/index.d.ts +42 -41
  12. package/packages/sdk/dist/{dataManagementApi-p_HOhQnA.d.mts → dataManagementApi-4fSaCA5t.d.mts} +2 -2
  13. package/packages/sdk/dist/{dataManagementApi-Ro9itwm8.d.ts → dataManagementApi-CE8Zyj3a.d.ts} +2 -2
  14. package/packages/sdk/dist/runtime/index.d.mts +4 -3
  15. package/packages/sdk/dist/runtime/index.d.ts +4 -3
  16. package/packages/sdk/dist/runtime/react.d.mts +5 -5
  17. package/packages/sdk/dist/runtime/react.d.ts +5 -5
  18. package/templates/openxiangda-react-spa/AGENTS.md +2 -0
  19. package/templates/sy-lowcode-app-workspace/AGENTS.md +1 -1
  20. package/v2/README.md +0 -35
  21. package/v2/skills/manifest.json +0 -45
  22. package/v2/skills/openxiangda-v1-maintenance/SKILL.md +0 -21
  23. package/v2/skills/openxiangda-v1-maintenance/agents/openai.yaml +0 -4
  24. package/v2/skills/openxiangda-v2/SKILL.md +0 -38
  25. package/v2/skills/openxiangda-v2/agents/openai.yaml +0 -4
  26. package/v2/skills/openxiangda-v2-architecture/SKILL.md +0 -29
  27. package/v2/skills/openxiangda-v2-architecture/agents/openai.yaml +0 -4
  28. package/v2/skills/openxiangda-v2-backend/SKILL.md +0 -28
  29. package/v2/skills/openxiangda-v2-backend/agents/openai.yaml +0 -4
  30. package/v2/skills/openxiangda-v2-data-authz/SKILL.md +0 -28
  31. package/v2/skills/openxiangda-v2-data-authz/agents/openai.yaml +0 -4
  32. package/v2/skills/openxiangda-v2-delivery/SKILL.md +0 -30
  33. package/v2/skills/openxiangda-v2-delivery/agents/openai.yaml +0 -4
  34. package/v2/skills/openxiangda-v2-frontend/SKILL.md +0 -21
  35. package/v2/skills/openxiangda-v2-frontend/agents/openai.yaml +0 -4
  36. package/v2/skills/openxiangda-v2-workflow-events/SKILL.md +0 -28
  37. package/v2/skills/openxiangda-v2-workflow-events/agents/openai.yaml +0 -4
@@ -1,6 +1,6 @@
1
- import * as React from 'react';
2
1
  import React__default, { Dispatch, SetStateAction, CSSProperties, Key, ReactNode, HTMLAttributes } from 'react';
3
- import { bg as RuntimeAuthHeadersProvider, a as FormRuntimeApi, a9 as AttachmentItem, ab as FilePreviewCapability, aa as PreparedFilePreview, o as InitiatorSelectRequirement, I as InitiatorSelectCandidate, bf as ProcessPreviewProps, an as ApprovalTimelineProps } from '../ProcessPreview-DSUIJi5V.mjs';
2
+ import { a$ as RuntimeAuthHeadersProvider, a9 as FormRuntimeApi, l as AttachmentItem, S as FilePreviewCapability, aJ as PreparedFilePreview, ao as InitiatorSelectRequirement, an as InitiatorSelectCandidate, aR as ProcessPreviewProps, e as ApprovalTimelineProps } from '../ProcessPreview-Cyk6uv-w.mjs';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
 
5
5
  type PageQueryValue = string | string[];
6
6
  type PageHttpMethod = "get" | "post" | "put" | "delete" | "patch";
@@ -2576,7 +2576,7 @@ interface AttachmentPreviewListProps {
2576
2576
  className?: string;
2577
2577
  }
2578
2578
  /** Read-only attachment list with capability-aware preview and download actions. */
2579
- declare const AttachmentPreviewList: ({ items, appType, bucketName, showPreview, showDownload, showFileSize, showFileTypeBadge, emptyText, className, }: AttachmentPreviewListProps) => React__default.JSX.Element;
2579
+ declare const AttachmentPreviewList: ({ items, appType, bucketName, showPreview, showDownload, showFileSize, showFileTypeBadge, emptyText, className, }: AttachmentPreviewListProps) => react_jsx_runtime.JSX.Element;
2580
2580
  interface ImagePreviewGridProps {
2581
2581
  items?: AttachmentItem[];
2582
2582
  appType?: string;
@@ -2588,7 +2588,7 @@ interface ImagePreviewGridProps {
2588
2588
  className?: string;
2589
2589
  }
2590
2590
  /** Read-only image grid that opens the current item in the shared preview gallery. */
2591
- declare const ImagePreviewGrid: ({ items, appType, bucketName, showPreview, showDownload, showFileName, emptyText, className, }: ImagePreviewGridProps) => React__default.JSX.Element;
2591
+ declare const ImagePreviewGrid: ({ items, appType, bucketName, showPreview, showDownload, showFileName, emptyText, className, }: ImagePreviewGridProps) => react_jsx_runtime.JSX.Element;
2592
2592
  type FilePreviewItem = AttachmentItem;
2593
2593
 
2594
2594
  type SelectedApproverMap = Record<string, InitiatorSelectCandidate[]>;
@@ -3129,7 +3129,7 @@ interface AdminListProps<Row> {
3129
3129
  onRow?: (row: Row) => HTMLAttributes<HTMLTableRowElement>;
3130
3130
  }
3131
3131
 
3132
- declare function AdminList<Row>(props: AdminListProps<Row>): React.JSX.Element;
3132
+ declare function AdminList<Row>(props: AdminListProps<Row>): react_jsx_runtime.JSX.Element;
3133
3133
 
3134
3134
  declare function createFormAdminListSource<Row>(options: AdminListFormSourceOptions): AdminListDataSource<Row>;
3135
3135
  declare function createDataViewAdminListSource<Row>(options: AdminListDataViewSourceOptions): AdminListDataSource<Row>;
@@ -1,6 +1,6 @@
1
- import * as React from 'react';
2
1
  import React__default, { Dispatch, SetStateAction, CSSProperties, Key, ReactNode, HTMLAttributes } from 'react';
3
- import { bg as RuntimeAuthHeadersProvider, a as FormRuntimeApi, a9 as AttachmentItem, ab as FilePreviewCapability, aa as PreparedFilePreview, o as InitiatorSelectRequirement, I as InitiatorSelectCandidate, bf as ProcessPreviewProps, an as ApprovalTimelineProps } from '../ProcessPreview-DSUIJi5V.js';
2
+ import { a$ as RuntimeAuthHeadersProvider, a9 as FormRuntimeApi, l as AttachmentItem, S as FilePreviewCapability, aJ as PreparedFilePreview, ao as InitiatorSelectRequirement, an as InitiatorSelectCandidate, aR as ProcessPreviewProps, e as ApprovalTimelineProps } from '../ProcessPreview-Cyk6uv-w.js';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
 
5
5
  type PageQueryValue = string | string[];
6
6
  type PageHttpMethod = "get" | "post" | "put" | "delete" | "patch";
@@ -2576,7 +2576,7 @@ interface AttachmentPreviewListProps {
2576
2576
  className?: string;
2577
2577
  }
2578
2578
  /** Read-only attachment list with capability-aware preview and download actions. */
2579
- declare const AttachmentPreviewList: ({ items, appType, bucketName, showPreview, showDownload, showFileSize, showFileTypeBadge, emptyText, className, }: AttachmentPreviewListProps) => React__default.JSX.Element;
2579
+ declare const AttachmentPreviewList: ({ items, appType, bucketName, showPreview, showDownload, showFileSize, showFileTypeBadge, emptyText, className, }: AttachmentPreviewListProps) => react_jsx_runtime.JSX.Element;
2580
2580
  interface ImagePreviewGridProps {
2581
2581
  items?: AttachmentItem[];
2582
2582
  appType?: string;
@@ -2588,7 +2588,7 @@ interface ImagePreviewGridProps {
2588
2588
  className?: string;
2589
2589
  }
2590
2590
  /** Read-only image grid that opens the current item in the shared preview gallery. */
2591
- declare const ImagePreviewGrid: ({ items, appType, bucketName, showPreview, showDownload, showFileName, emptyText, className, }: ImagePreviewGridProps) => React__default.JSX.Element;
2591
+ declare const ImagePreviewGrid: ({ items, appType, bucketName, showPreview, showDownload, showFileName, emptyText, className, }: ImagePreviewGridProps) => react_jsx_runtime.JSX.Element;
2592
2592
  type FilePreviewItem = AttachmentItem;
2593
2593
 
2594
2594
  type SelectedApproverMap = Record<string, InitiatorSelectCandidate[]>;
@@ -3129,7 +3129,7 @@ interface AdminListProps<Row> {
3129
3129
  onRow?: (row: Row) => HTMLAttributes<HTMLTableRowElement>;
3130
3130
  }
3131
3131
 
3132
- declare function AdminList<Row>(props: AdminListProps<Row>): React.JSX.Element;
3132
+ declare function AdminList<Row>(props: AdminListProps<Row>): react_jsx_runtime.JSX.Element;
3133
3133
 
3134
3134
  declare function createFormAdminListSource<Row>(options: AdminListFormSourceOptions): AdminListDataSource<Row>;
3135
3135
  declare function createDataViewAdminListSource<Row>(options: AdminListDataViewSourceOptions): AdminListDataSource<Row>;
@@ -59,6 +59,8 @@ openxiangda studio
59
59
  openxiangda commands --json
60
60
  ```
61
61
 
62
+ 未登记环境的旧工作区只有在平台已核验“精确非删除目标来自多次历史发布、无法对应单一 Git 基线”时,才可在同一条 `release publish` 上增加 `--adopt-online-baseline --adoption-reason "..."`。CLI 只把该意图传给精确 `resource publish --only/--code` 阶段;表单 ensure、Runtime 与 App finalize 不接收,原因不足或没有精确资源阶段会在获取租约前失败关闭。
63
+
62
64
  模板已停用无范围的 `pnpm deploy` 聚合入口。日常变更必须使用 `resource plan|publish <type> --only <codes>`(单资源可用 `--code <code>`)。Form bundle、Backend Release 和 Runtime 都先暂存;CLI 会按 `--change` 自动聚合 `.openxiangda/releases/<change>/staged-resources.json`,最后只由一次 Root App finalize 原子激活。Form Release 一旦 abort 绝不能作为幂等结果复用;重新执行相同精确表单发布时,CLI 会淘汰旧 staged 索引,平台会创建新的不可变 attempt,再由 Root App 一次事务重试。相同 change 的既有 staged FormRelease 只有在 CLI 重新核验服务端不可变状态、identity/hash、冻结 schema/formType、finalized 资源、parent/base revision 和当前 Form Head 后,才可重挂接到新的 baseline/session;`schemaSyncedAt` 只是本地缓存元数据。禁止伪造它、提前激活 Form 或用顺序激活多张表单绕过失败。不要使用 `workspace publish --form`、单独 `runtime activate`、`pnpm publish:all`、`pnpm openxiangda:publish` 或 `lowcode-workspace publish-all`。
63
65
 
64
66
  同一发布同时包含 Form 设置和表单权限组时,必须由一条 `resource publish form-setting,form-permission-group` 命令暂存,并在 `--only` 中分别使用 `form-setting:<code>`、`form-permission-group:<code>`。SDD bundle 与 prepublish 校验使用同一精确契约;缺失、夹带、拆成两个 FormRelease 或提前激活都应失败关闭。
@@ -65,7 +65,7 @@ Delivery V2 自动从期望状态按资源指纹计算精确范围,使用 CLI
65
65
  - ✅ Function/Automation 使用 Backend Release v2;正式多资源发布用精确 `--only/--code` 加 `--stage-only` 暂存,同一 child 可混合源码 create、无 `sourceFile` 的完整 v3 声明式 Automation manifest create、source-only update 和显式 manifest replacement,再由 Root App finalize 原子激活。声明式 create 自动选路;替换已有资源的整包 manifest 才需要另加 `--replace-manifest --reason "..."`。clone primary 与冻结仓库 ID 不同时,只有冻结 ID 已存在于 `repoAliases` 才会统一用于 Backend/Workflow/Root App Release;无交集继续失败关闭。
66
66
  - ✅ 相同 change 已有 staged FormRelease 时,不要直发 schema、伪造 `schemaSyncedAt` 或提前激活 Form。CLI 只在重新核验服务端不可变状态、identity/hash、冻结 schema/formType、finalized 资源、parent/base revision 与当前 Form Head 后,才将 child 重挂接到新的 baseline/session;冲突继续失败关闭。
67
67
  - ✅ 同一发布同时包含 Form 设置和表单权限组时,必须使用一条 `resource publish form-setting,form-permission-group`,并以 `form-setting:<code>`、`form-permission-group:<code>` 精确限定 `--only`;SDD bundle 与 prepublish 校验共享该契约,禁止缺失、夹带、拆分发布或提前激活。
68
- - ✅ 未登记环境的旧工作区,正式 promotion 先聚合 mainline bundle 并 commit/push,再运行 `release publish --change <id> --profile <name>`。
68
+ - ✅ 未登记环境的旧工作区,正式 promotion 先聚合 mainline bundle 并 commit/push,再运行 `release publish --change <id> --profile <name>`。平台核验精确非删除目标来自多次历史 lineage 后,可成对增加 `--adopt-online-baseline --adoption-reason "..."`;参数只进入精确 `resource publish --only/--code` 阶段,不进入 ensure、Runtime 或 App finalize,无精确资源范围时在获取租约前失败关闭。
69
69
  - ✅ 旧工作区已有 Root、且操作者明确授权无条件恢复时,可执行 `release app-activate <releaseId> --force-activate-without-validation --profile <name>`。该命令不读取 detail/capture,不要求 change、租约、baseline、源码 lineage、状态、parent、hash、resource head 或环境发布门禁;服务端直接在目标 tenant/appType 内以单事务切换 Root 与可识别的 staged children。
70
70
  - ✅ 已通过 `environment init` 或 `environment attach` 接入的工作区使用 `release ship`,始终按 candidate → preproduction → production 执行。日常首条命令在预发停止,后续 `--confirm-production` 晋级;用户明确授权紧急发布时,首条命令可携带 `--confirm-production` 在一个命令内顺序完成两阶段,但不跳过预发、证据、CAS 或确认。candidate 封存源码、public、构建配置/脚本、稳定环境/资源绑定和两目标 Runtime 哈希产物;部署不现场重建,Backend/Runtime/Root 子发布始终使用 candidate sourceRevision,并将两条服务端 deployment 闭环为 `succeeded`。两套环境身份仍完全隔离,人工验收建议和 swap/policy/权限门禁保持不变。
71
71
  - ✅ DataView `status` 仅是平台生命周期观察值;同一托管部署导致的 `active → draft → active` 不应让候选失效。`dataViewId`、`materializedViewName`、`storageMode`、其他资源状态、哈希、环境身份、CAS、租约和来源主线仍严格校验。
package/v2/README.md DELETED
@@ -1,35 +0,0 @@
1
- # OpenXiangda 2.0 toolchain
2
-
3
- This directory is the isolated OpenXiangda 2.0 package workspace. It does not
4
- import or dispatch the 1.x CLI implementation in `lib/cli.js`.
5
-
6
- Current packages:
7
-
8
- - `@openxiangda/contracts`: versioned wire contracts and JSON Schemas.
9
- - `@openxiangda/compiler`: deterministic configuration, generated contracts and AppPackage sealing.
10
- - `@openxiangda/devkit-core`: framework-neutral workspace, package and control-plane use cases.
11
- - `@openxiangda/nest`: trusted Principal/RoleSession Guard, Data API client,
12
- signed CloudEvents receiver and standard backend health endpoints.
13
- - `@openxiangda/admin`: React + Ant Design application shell, capability-aware
14
- data pages and protocol-driven Workflow v2/1.x compatibility pages.
15
- - `@openxiangda/testing`: permission fixtures, allow/deny matrix assertions and
16
- local event record/replay/simulation.
17
- - `create-openxiangda`: distributable standard application workspace creator.
18
- - `@openxiangda/cli`: thin Oclif application-level CLI.
19
- - `@openxiangda/mcp`: structured AI resources and tools over the same services.
20
- - `@openxiangda/skill-kit`: validation, packaging and installation for the 2.0 domain skills.
21
-
22
- `templates/application` is the build-verified React 19 + NestJS 11 golden
23
- workspace. None of these packages imports or dispatches the 1.x CLI, so this
24
- toolchain can evolve without increasing the stable 1.x launcher surface.
25
-
26
- ```bash
27
- pnpm install
28
- pnpm check
29
- pnpm test
30
- pnpm template:build
31
- pnpm skills:check
32
- pnpm docs:build
33
- ```
34
-
35
- The fixed Changesets group publishes the packages as one compatible version train. See `docs/getting-started.md` for application usage and `docs/migration.md` for the strict 1.x coexistence boundary.
@@ -1,45 +0,0 @@
1
- {
2
- "schemaVersion": 1,
3
- "skills": [
4
- {
5
- "name": "openxiangda-v1-maintenance",
6
- "description": "Maintain an existing stable OpenXiangda 1.x application without migrating it. Use for scoped fixes to legacy pages, forms, resources, App Function code, automation, workflow, or 1.x release records.",
7
- "sha256": "7f554b8092397a0994f6aba70be38d2ec7eaf7524a075d68fb99ecbc95303525"
8
- },
9
- {
10
- "name": "openxiangda-v2",
11
- "description": "Build, inspect, validate, and deliver a complete OpenXiangda 2.0 application workspace. Use when a task spans the React frontend, NestJS backend, Data API, authorization, workflow, events, or whole-application delivery.",
12
- "sha256": "5645e5cb1c18731d5b5fb21c9ad0e59b9760600794705bb4adcad1d0e316010b"
13
- },
14
- {
15
- "name": "openxiangda-v2-architecture",
16
- "description": "Design OpenXiangda 2.0 application boundaries and typed contracts. Use when creating an app, decomposing frontend and backend responsibilities, or changing Data, AuthZ, workflow, event, or deployment declarations.",
17
- "sha256": "02768b17e048c623a13b9a99e5cedc72c9081eaa71b346c3d9db3ca66c95bf5e"
18
- },
19
- {
20
- "name": "openxiangda-v2-backend",
21
- "description": "Build the standard OpenXiangda 2.0 NestJS application backend. Use when implementing App APIs, Data API transactions, identity-aware business services, event consumers, health checks, or external integration endpoints.",
22
- "sha256": "04c3de82f4406eaeb378910fbd53e2721c13e1cb9afbeb39f1c63f352522dd39"
23
- },
24
- {
25
- "name": "openxiangda-v2-data-authz",
26
- "description": "Design OpenXiangda 2.0 Data API and contextual authorization contracts. Use for RBAC, active-role behavior, department or record attributes, application-admin bypass, field policies, and restricted transactions.",
27
- "sha256": "595fe9b8edc1e9b33720de21ed8758d4c266143c84fcb9eccc25a6adb5cce061"
28
- },
29
- {
30
- "name": "openxiangda-v2-delivery",
31
- "description": "Validate, build, deploy, observe, promote, retry, and roll back an OpenXiangda 2.0 application. Use when preparing an immutable AppPackage or changing a platform-managed environment.",
32
- "sha256": "0ee0ffef78ebe37f60319bbf5684522ce61f8d6d084c360f46dc7bb2a31d1906"
33
- },
34
- {
35
- "name": "openxiangda-v2-frontend",
36
- "description": "Build OpenXiangda 2.0 React and Ant Design admin experiences. Use when implementing menus, routes, CRUD pages, role switching, workflow task pages, or application-defined action components.",
37
- "sha256": "26add1dadeaf9a0a25d41163fb65cb70c1c5c7d882d57922193c3bd11d9d3e05"
38
- },
39
- {
40
- "name": "openxiangda-v2-workflow-events",
41
- "description": "Implement OpenXiangda Workflow Kernel v2 and durable application events. Use for approval definitions, assignee providers, task actions, delegation, add-sign, previews, data-change events, workflow events, or timers.",
42
- "sha256": "e32a5dc84e21d32a00fbfff62a349d848b04d44a569eb4f89b390901f54bb19e"
43
- }
44
- ]
45
- }
@@ -1,21 +0,0 @@
1
- ---
2
- name: openxiangda-v1-maintenance
3
- description: Maintain an existing stable OpenXiangda 1.x application without migrating it. Use for scoped fixes to legacy pages, forms, resources, App Function code, automation, workflow, or 1.x release records.
4
- ---
5
-
6
- # OpenXiangda 1.x Maintenance
7
-
8
- Preserve the installed 1.x runtime and its existing SDD, resource, function, automation, and workflow release process. Do not reinterpret the workspace as a 2.0 application package.
9
-
10
- ## Maintenance Workflow
11
-
12
- 1. Inspect the existing workspace and platform state with the installed 1.x OpenXiangda skills.
13
- 2. Run `openxiangda sdd context --json` and create or select the required SDD change.
14
- 3. Change only the named legacy resource. Keep existing identifiers and dependency order.
15
- 4. Validate 1.x JS_CODE, App Function, page, form, automation, or workflow artifacts with their dedicated 1.x skill.
16
- 5. Run `openxiangda sdd verify <change> --changed` and use the established 1.x publish gate.
17
- 6. Verify the live application without migrating its runtime, data model, or deployment topology.
18
-
19
- Do not use 2.0 build, deploy, promote, or rollback commands for a 1.x workspace. Migration is a separate, explicitly approved project.
20
-
21
- Read [1.x Migration Boundary](../../docs/migration.md) before proposing any coexistence or migration work.
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "OpenXiangda 1.x Maintenance"
3
- short_description: "Maintain stable OpenXiangda 1.x applications safely"
4
- default_prompt: "Use $openxiangda-v1-maintenance to make a scoped maintenance change to this 1.x application."
@@ -1,38 +0,0 @@
1
- ---
2
- name: openxiangda-v2
3
- description: Build, inspect, validate, and deliver a complete OpenXiangda 2.0 application workspace. Use when a task spans the React frontend, NestJS backend, Data API, authorization, workflow, events, or whole-application delivery.
4
- ---
5
-
6
- # OpenXiangda 2.0
7
-
8
- Treat the repository as one typed application product. Work through package contracts and deterministic commands; do not mutate platform resources one at a time.
9
-
10
- ## Start Here
11
-
12
- 1. Run `openxiangda app info` and inspect the returned workspace and platform contract versions.
13
- 2. Read `openxiangda.config.ts`, then identify which domain skill applies:
14
- - architecture: `$openxiangda-v2-architecture`
15
- - frontend: `$openxiangda-v2-frontend`
16
- - backend: `$openxiangda-v2-backend`
17
- - data and authorization: `$openxiangda-v2-data-authz`
18
- - workflow and events: `$openxiangda-v2-workflow-events`
19
- - delivery: `$openxiangda-v2-delivery`
20
- 3. Keep generated contracts current with `openxiangda generate`.
21
- 4. Before delivery, run `openxiangda check` and `openxiangda test`.
22
-
23
- For a new repository, link it to the target platform and let an authorized platform administrator run `openxiangda app provision` once. The command is idempotent and must not be used to migrate an existing 1.x identity.
24
-
25
- ## Boundaries
26
-
27
- - Put browser code in `apps/web`, server code in `apps/server`, shared domain types in `packages/domain`, and generated declarations in `packages/contracts`.
28
- - Persist business records only through Data API or an App API implemented by the application backend.
29
- - Treat the active role and context attributes as explicit request state.
30
- - Use durable event consumers for side effects and idempotency keys for retries.
31
- - Build one immutable application package; the platform owns deployment execution, health gates, promotion, and rollback.
32
- - For a stable 1.x workspace, stop and use `$openxiangda-v1-maintenance`.
33
-
34
- ## Delivery Gate
35
-
36
- Use `openxiangda build --backend-image <immutable-image>` only after checks pass. Use `openxiangda deploy`, `openxiangda status`, and `openxiangda logs` only when the user has authorized the environment change.
37
-
38
- Read [Getting Started](../../docs/getting-started.md) for the complete development loop.
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "OpenXiangda 2.0"
3
- short_description: "Build and deliver typed OpenXiangda 2.0 applications"
4
- default_prompt: "Use $openxiangda-v2 to build and validate this OpenXiangda 2.0 application."
@@ -1,29 +0,0 @@
1
- ---
2
- name: openxiangda-v2-architecture
3
- description: Design OpenXiangda 2.0 application boundaries and typed contracts. Use when creating an app, decomposing frontend and backend responsibilities, or changing Data, AuthZ, workflow, event, or deployment declarations.
4
- ---
5
-
6
- # OpenXiangda 2.0 Architecture
7
-
8
- Design one independently versioned application with a standard React frontend and NestJS backend.
9
-
10
- ## Design Sequence
11
-
12
- 1. Inspect the workspace with `openxiangda app info`.
13
- 2. Define business aggregates and invariants in `packages/domain`.
14
- 3. Declare Data API resources, capabilities, policies, workflow definitions, event subscriptions, and timers in `openxiangda.config.ts`.
15
- 4. Keep synchronous user interactions in App APIs; move retryable side effects to event consumers.
16
- 5. Use a workflow provider when assignee resolution or a workflow action depends on application data.
17
- 6. Generate types with `openxiangda generate`, then run `openxiangda check`.
18
-
19
- ## Required Decisions
20
-
21
- - Name every resource, capability, event type, workflow, and provider with a stable application-scoped code.
22
- - Separate business data from workflow runtime state.
23
- - Define the authorization context needed for each operation, including active role and data attributes.
24
- - Define idempotency and concurrency behavior before implementing writes.
25
- - Define health, readiness, and rollback expectations as part of the application contract.
26
-
27
- Do not design environment-specific code paths. Environment values and secrets are injected by the platform at deployment time.
28
-
29
- Read [Concepts](../../docs/concepts.md) before introducing a new platform-facing contract.
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "OpenXiangda 2.0 Architecture"
3
- short_description: "Design typed OpenXiangda 2.0 application boundaries"
4
- default_prompt: "Use $openxiangda-v2-architecture to design this OpenXiangda 2.0 application."
@@ -1,28 +0,0 @@
1
- ---
2
- name: openxiangda-v2-backend
3
- description: Build the standard OpenXiangda 2.0 NestJS application backend. Use when implementing App APIs, Data API transactions, identity-aware business services, event consumers, health checks, or external integration endpoints.
4
- ---
5
-
6
- # OpenXiangda 2.0 Backend
7
-
8
- Build a normal NestJS service in `apps/server`. The platform deploys one container per application and injects identity, platform endpoints, environment configuration, and secrets.
9
-
10
- ## Request Path
11
-
12
- 1. Use the platform guard to verify the user token and construct typed request context.
13
- 2. Authorize the capability and contextual data policy before accessing records.
14
- 3. Keep invariants in domain services, not controllers.
15
- 4. Use Data API for persistence and its restricted transaction endpoint for atomic batches.
16
- 5. Require revision or idempotency keys for retryable writes.
17
- 6. Return stable application contracts and structured errors.
18
-
19
- ## Runtime Path
20
-
21
- - Expose liveness and readiness endpoints.
22
- - Consume platform events with signature verification and durable idempotency.
23
- - Keep outbound integrations behind adapters with timeouts and correlation IDs.
24
- - Read secrets only from injected environment references; never place them in source or application packages.
25
-
26
- Use `openxiangda dev` for local orchestration. Run `openxiangda check`, `openxiangda test`, and `openxiangda build --backend-image <immutable-image>` before deployment.
27
-
28
- Read [Backend](../../docs/backend.md) for the standard module layout.
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "OpenXiangda 2.0 Backend"
3
- short_description: "Build standard NestJS application backend services"
4
- default_prompt: "Use $openxiangda-v2-backend to implement this OpenXiangda 2.0 backend."
@@ -1,28 +0,0 @@
1
- ---
2
- name: openxiangda-v2-data-authz
3
- description: Design OpenXiangda 2.0 Data API and contextual authorization contracts. Use for RBAC, active-role behavior, department or record attributes, application-admin bypass, field policies, and restricted transactions.
4
- ---
5
-
6
- # OpenXiangda 2.0 Data and AuthZ
7
-
8
- Model permissions as capability checks plus contextual data predicates. A role grants capabilities; policies decide which records and fields are available in the current role context.
9
-
10
- ## Authorization Model
11
-
12
- 1. Declare application roles and stable capability codes.
13
- 2. Treat the selected active role as part of each request. Do not silently union all user roles.
14
- 3. Resolve subject attributes such as departments and managed colleges from trusted platform or application providers.
15
- 4. Resolve resource attributes such as instrument manager and college from the target record.
16
- 5. Express allow rules as explicit subject, action, resource, and environment predicates.
17
- 6. Grant application administrators the declared application-admin bypass and audit every bypassed write.
18
-
19
- ## Data Rules
20
-
21
- - Declare resources and fields in `openxiangda.config.ts`; generate types with `openxiangda generate`.
22
- - Prefer server-enforced filters and field policies over client filtering.
23
- - Use revision checks for updates and restricted transaction batches for related writes.
24
- - Keep policy tests for multiple roles, role switching, cross-department denial, and administrator access.
25
-
26
- Run `openxiangda check` and `openxiangda test` after every policy or schema change.
27
-
28
- Read [Data and Authorization](../../docs/data-authz.md) for policy examples.
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "OpenXiangda 2.0 Data and AuthZ"
3
- short_description: "Model Data API contracts and contextual authorization"
4
- default_prompt: "Use $openxiangda-v2-data-authz to design this application's data authorization."
@@ -1,30 +0,0 @@
1
- ---
2
- name: openxiangda-v2-delivery
3
- description: Validate, build, deploy, observe, promote, retry, and roll back an OpenXiangda 2.0 application. Use when preparing an immutable AppPackage or changing a platform-managed environment.
4
- ---
5
-
6
- # OpenXiangda 2.0 Delivery
7
-
8
- Deliver the whole application as one immutable version. The client submits intent; the platform owns durable execution and environment state.
9
-
10
- ## Preflight
11
-
12
- 1. Run `openxiangda doctor` and confirm client/platform contract compatibility.
13
- 2. For a first deployment only, confirm an authorized platform administrator has run `openxiangda app provision`.
14
- 3. Run `openxiangda generate --check`, `openxiangda check`, and `openxiangda test`.
15
- 4. Build and push the backend image; use an immutable digest reference.
16
- 5. Run `openxiangda build --backend-image <immutable-image>` and retain the returned package digest.
17
-
18
- ## Deployment
19
-
20
- - Inspect the plan before changing an environment.
21
- - Use `openxiangda deploy` only with explicit user authorization.
22
- - Follow the durable run with `openxiangda status` and `openxiangda logs`.
23
- - Use `openxiangda retry` only for retryable failed runs.
24
- - Use `openxiangda cancel <deploymentId>` to stop an obsolete or blocked run before submitting a replacement package.
25
- - Use `openxiangda promote` to move the exact same application version between environments.
26
- - Use `openxiangda rollback` to create a new run that activates a known historical version.
27
-
28
- Do not rebuild during promotion or rollback. Do not expose injected secrets in logs, manifests returned to clients, or package metadata.
29
-
30
- Read [Delivery](../../docs/delivery.md) for gates and failure handling.
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "OpenXiangda 2.0 Delivery"
3
- short_description: "Build deploy observe promote and rollback whole apps"
4
- default_prompt: "Use $openxiangda-v2-delivery to validate and deploy this OpenXiangda 2.0 application."
@@ -1,21 +0,0 @@
1
- ---
2
- name: openxiangda-v2-frontend
3
- description: Build OpenXiangda 2.0 React and Ant Design admin experiences. Use when implementing menus, routes, CRUD pages, role switching, workflow task pages, or application-defined action components.
4
- ---
5
-
6
- # OpenXiangda 2.0 Frontend
7
-
8
- Build inside `apps/web` with `@openxiangda/admin`. Preserve the standard shell, role session, route guards, error handling, and typed clients.
9
-
10
- ## Implementation Rules
11
-
12
- 1. Register menus and routes through the application contribution API.
13
- 2. Gate navigation and actions with generated capability names; the server remains authoritative.
14
- 3. Use the active-role session supplied by the platform. Switching roles must refresh permissions and scoped data.
15
- 4. Use the standard CRUD and workflow modules first; add application components only for real domain interactions.
16
- 5. Render workflow actions and field policies from the backend protocol. Do not duplicate workflow transition rules in the browser.
17
- 6. Keep data calls in typed client modules rather than components.
18
-
19
- Run `openxiangda generate`, `openxiangda check`, and `openxiangda test` after changing contracts or pages. Use accessible Ant Design patterns and run the repository's Ant Design lint when available.
20
-
21
- Read [Frontend](../../docs/frontend.md) for route, menu, role, and workflow page examples.
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "OpenXiangda 2.0 Frontend"
3
- short_description: "Build standard React and Ant Design application pages"
4
- default_prompt: "Use $openxiangda-v2-frontend to implement this OpenXiangda 2.0 frontend."
@@ -1,28 +0,0 @@
1
- ---
2
- name: openxiangda-v2-workflow-events
3
- description: Implement OpenXiangda Workflow Kernel v2 and durable application events. Use for approval definitions, assignee providers, task actions, delegation, add-sign, previews, data-change events, workflow events, or timers.
4
- ---
5
-
6
- # OpenXiangda 2.0 Workflow and Events
7
-
8
- The workflow kernel owns definitions, instances, tasks, transitions, delegation, add-sign, audit, and field policies. The application owns business records and application-specific logic.
9
-
10
- ## Workflow
11
-
12
- 1. Declare approval and conditional nodes in `openxiangda.config.ts`.
13
- 2. Use provider contracts for application-data-dependent assignee resolution and custom action decisions.
14
- 3. Keep submit preview and actual start on the same definition version and subject context.
15
- 4. Return allowed actions, field policies, presentation hints, and concurrency tokens from the backend.
16
- 5. Persist business changes through Data API or App API, then correlate them to the workflow action.
17
- 6. Test approve, reject, transfer, return, delegation, add-sign, duplicate requests, and stale revisions.
18
-
19
- ## Events
20
-
21
- - Subscribe to typed data and workflow events; implement idempotent consumers.
22
- - Use timers as durable event producers.
23
- - Verify signatures, propagate correlation IDs, and fail retryably for transient dependencies.
24
- - Never assume event ordering unless the contract explicitly provides a partition key.
25
-
26
- Use `openxiangda generate`, `openxiangda check`, and `openxiangda test` to keep providers and event payloads aligned.
27
-
28
- Read [Workflow and Events](../../docs/workflow-events.md) for protocol details.
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "OpenXiangda 2.0 Workflow and Events"
3
- short_description: "Implement workflow providers and durable event consumers"
4
- default_prompt: "Use $openxiangda-v2-workflow-events to implement this workflow and event behavior."