openxiangda-cli 2.0.0-alpha.178 → 2.0.0-alpha.179
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/README.md +4 -48
- package/dist/base.d.ts.map +1 -1
- package/dist/base.js +2 -27
- package/dist/base.js.map +1 -1
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +5 -3
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/context.d.ts +27 -0
- package/dist/commands/context.d.ts.map +1 -0
- package/dist/commands/context.js +10 -0
- package/dist/commands/context.js.map +1 -0
- package/dist/commands/deploy.d.ts +1 -0
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +9 -14
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/docs.d.ts +30 -0
- package/dist/commands/docs.d.ts.map +1 -0
- package/dist/commands/docs.js +20 -0
- package/dist/commands/docs.js.map +1 -0
- package/dist/commands/skill.d.ts +1 -0
- package/dist/commands/skill.d.ts.map +1 -1
- package/dist/commands/skill.js +9 -2
- package/dist/commands/skill.js.map +1 -1
- package/package.json +6 -6
- package/template/AGENTS.md +16 -57
- package/template/README.md +25 -50
- package/template/apps/web/package.json +1 -1
- package/template/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,53 +1,9 @@
|
|
|
1
1
|
# openxiangda-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
这是根包 CLI 的内部实现,应用通过 `openxiangda` 安装和运行。命令覆盖创建、上下文、中文资料、开发、统一检查、部署、状态、日志、恢复、环境启停、AppSpec 和 Skill 安装;完整参数运行 `pnpm openxiangda docs cli`。
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
latest failures, candidate identity/state, recovery decision and append-only
|
|
7
|
-
attempt ledger; `logs` preserves those fields. The CLI follows only the
|
|
8
|
-
published recovery command and never advertises cancel after activation.
|
|
5
|
+
默认开发连接远端测试平台,自定义 Nest 后端按需启用。check 会生成并检查、测试、构建;前置失败时停止。deploy 已包含检查,生产只能晋级成功测试版本。平台 recovery 是恢复操作的权威。
|
|
9
6
|
|
|
10
|
-
|
|
7
|
+
`--json` 输出一个 `openxiangda.cli-result/v2`。Studio 集成在 create、dev、check、deploy、logs、rollback 使用 `--json-events --run-id <uuid>`,每行一个 `openxiangda.cli-event/v1`;与 --json 互斥。模板引用和摘要成对验证;站点绑定初始化保留 ProjectProvisioningRun 对 Application 与 Git 的权威。
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
`logs`, and `rollback`. Each stdout line is one
|
|
14
|
-
`openxiangda.cli-event/v1` event with a stable AgentRun `--run-id`, ordered
|
|
15
|
-
sequence, timestamp and payload; terminal events carry the existing
|
|
16
|
-
`openxiangda.cli-result/v2` envelope. `--json` and `--json-events` are mutually
|
|
17
|
-
exclusive. `check` remains the only public check entry and reports its internal
|
|
18
|
-
test/build stages instead of adding public `test` or `build` commands.
|
|
19
|
-
|
|
20
|
-
Studio can create an application with explicit `--app-code` and `--name`.
|
|
21
|
-
Custom `--template-ref` and `--template-digest` values must be supplied
|
|
22
|
-
together. The reference is either `builtin:application` or a local directory
|
|
23
|
-
already materialized by the caller, and the digest is
|
|
24
|
-
`sha256:<64 lowercase hex>`. The CLI never fetches a remote template and writes
|
|
25
|
-
the verified binding to `.openxiangda/template.json` before installation.
|
|
26
|
-
|
|
27
|
-
When the customer site has already created the Application through a Studio
|
|
28
|
-
`ProjectProvisioningRun`, use the explicit site-bound mode:
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
openxiangda create <directory> \
|
|
32
|
-
--app-code <platform-app-type> --name <name> \
|
|
33
|
-
--template-ref <ref> --template-digest <sha256:digest> \
|
|
34
|
-
--studio-project-id <uuid> --provisioning-run-id <uuid> \
|
|
35
|
-
--json-events --run-id <execution-uuid>
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
This mode never calls application provision and never accepts repository
|
|
39
|
-
identity or credentials. It writes a secret-free, fail-closed
|
|
40
|
-
`.openxiangda/studio-binding.json` and returns the verified template plus
|
|
41
|
-
configuration, contract, AI Catalog and compiler summaries. The site Project
|
|
42
|
-
saga remains authoritative for Application and Git readback.
|
|
43
|
-
|
|
44
|
-
AI-native development clients use the same pinned executable in pre-command
|
|
45
|
-
stdio mode: `pnpm exec openxiangda --mcp-stdio --cwd <workspace>`. They can read
|
|
46
|
-
`openxiangda://workspace/contracts` or call `contract_describe` to obtain the
|
|
47
|
-
compiler-owned `aiCatalog`, `aiCatalogDigest` and the typed copy-once
|
|
48
|
-
`adminNavigationAuthoring.suggestion`. Copy its expression into
|
|
49
|
-
`frontend.admin.navigation`; runtime never applies it automatically. This
|
|
50
|
-
transport does not add another executable and applications must not implement
|
|
51
|
-
a second MCP server.
|
|
52
|
-
|
|
53
|
-
`dev` starts local Web/Nest hot reload and a loopback connected proxy. `deploy` defaults to test; production explicitly reuses a successful test AppVersion. Application binding, initialization, generation, tests and builds are internal stages rather than separate commands.
|
|
9
|
+
MCP 复用同一命令的 `--mcp-stdio --cwd <工作区绝对路径>` 模式。插件动态加载已禁用,避免其他命令覆盖当前版本实现。
|
package/dist/base.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAE7C,OAAO,EAEL,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,8BAA8B,EAE/B,MAAM,yBAAyB,CAAC;AAIjC,eAAO,MAAM,cAAc;;CAE1B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;CAmB5B,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;CAGhC,CAAC;AAEF,8BAAsB,kBAAmB,SAAQ,OAAO;IACtD,MAAM,CAAC,cAAc,UAAQ;IAE7B,SAAS,CAAC,QAAQ,CAAC,QAAQ,iCAExB;IACH,OAAO,CAAC,iBAAiB,CAAC,CAAuB;IACjD,OAAO,CAAC,kBAAkB,CAAS;cAEnB,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE;IAiB1D,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;;;;;IAuB/C,SAAS,CAAC,oBAAoB;IAI9B,SAAS,CAAC,iBAAiB,CAAC,SAAS,SAAuB;IAa5D,SAAS,CAAC,gBAAgB,CACxB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM;IAWvC,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO;;;;;;;;;;;;;;;;IAmBpC,OAAO,CAAC,QAAQ;IAoChB,OAAO,CAAC,mBAAmB;IAU3B,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,gBAAgB;CAqCzB"}
|
package/dist/base.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { developerError } from 'openxiangda-devkit-core';
|
|
1
2
|
import { Command, Flags } from "@oclif/core";
|
|
2
3
|
import { randomUUID } from "node:crypto";
|
|
3
4
|
import { STUDIO_CLI_RESULT_SCHEMA_VERSION, } from "openxiangda-contracts";
|
|
@@ -103,39 +104,13 @@ export class OpenXiangdaCommand extends Command {
|
|
|
103
104
|
message.match(/^([A-Z][A-Z0-9_]+)/)?.[1] ||
|
|
104
105
|
"OPENXIANGDA_COMMAND_FAILED");
|
|
105
106
|
const nextCommand = this.errorNextCommand(code);
|
|
106
|
-
const declaredRemediation = error?.remote?.remediation ||
|
|
107
|
-
error?.data?.remediation;
|
|
108
|
-
const retryable = Boolean(error?.retryable ||
|
|
109
|
-
error?.remote?.retryable ||
|
|
110
|
-
(error?.status &&
|
|
111
|
-
Number(error.status) >= 500) ||
|
|
112
|
-
/NETWORK|TIMEOUT|UNAVAILABLE|RATE_LIMIT/.test(code));
|
|
113
|
-
const details = error?.data &&
|
|
114
|
-
typeof error.data === "object" &&
|
|
115
|
-
!Array.isArray(error.data)
|
|
116
|
-
? (error.data)
|
|
117
|
-
: undefined;
|
|
118
|
-
const pointer = (details && typeof details.pointer === "string"
|
|
119
|
-
? details.pointer
|
|
120
|
-
: undefined) ||
|
|
121
|
-
error?.remote?.path;
|
|
122
107
|
return {
|
|
123
108
|
schemaVersion: STUDIO_CLI_RESULT_SCHEMA_VERSION,
|
|
124
109
|
ok: false,
|
|
125
110
|
operation: this.id || "unknown",
|
|
126
111
|
workspace: null,
|
|
127
112
|
data: null,
|
|
128
|
-
error:
|
|
129
|
-
code,
|
|
130
|
-
message: message.replace(/^([A-Z][A-Z0-9_]+):\s*/, ""),
|
|
131
|
-
retryable,
|
|
132
|
-
remediation: typeof declaredRemediation === "string"
|
|
133
|
-
? declaredRemediation
|
|
134
|
-
: `运行 ${nextCommand}`,
|
|
135
|
-
nextCommand,
|
|
136
|
-
...(pointer ? { pointer } : {}),
|
|
137
|
-
...(details ? { details } : {}),
|
|
138
|
-
},
|
|
113
|
+
error: developerError(error, nextCommand),
|
|
139
114
|
};
|
|
140
115
|
}
|
|
141
116
|
envelope(result) {
|
package/dist/base.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,gCAAgC,GAEjC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,8BAA8B,EAC9B,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,wB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,EAAE,4CAA4C;YACtD,KAAK,EAAE,yCAAyC;YAChD,IAAI,EAAE,iCAAiC;SACxC,CAAC;QACF,MAAM,SAAS,GAAG,IAAI,CAAC,EAAE,CAAC;QAC1B,IAAI,SAAS,IAAI,cAAc,CAAC,SAAS,CAAC;YAAE,OAAO,cAAc,CAAC,SAAS,CAAE,CAAC;QAC9E,IAAI,mDAAmD,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACnE,OAAO,gCAAgC,CAAC;QAC1C,CAAC;QACD,IAAI,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,OAAO,oBAAoB,CAAC;QACpE,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,OAAO,wBAAwB,CAAC;QAC1D,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,OAAO,iBAAiB,CAAC;QAC/C,OAAO,mBAAmB,CAAC;IAC7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAwB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAwB,MAAM,YAAY,CAAC;AAGtE,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,kBAAkB;IACnD,MAAM,CAAC,OAAO,SAAqB;IACnC,MAAM,CAAC,KAAK;;;;;MAOV;IAEI,GAAG;;;;;;;;;;;;;;;;;;;CAOV"}
|
package/dist/commands/check.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Flags } from '@oclif/core';
|
|
2
2
|
import { OpenXiangdaCommand, studioWorkspaceFlags } from '../base.js';
|
|
3
|
+
import { checkApplication, DEVELOPER_ENVIRONMENTS } from 'openxiangda-devkit-core';
|
|
3
4
|
export default class Check extends OpenXiangdaCommand {
|
|
4
5
|
static summary = '针对目标平台确定性检查完整应用';
|
|
5
6
|
static flags = {
|
|
6
7
|
...studioWorkspaceFlags,
|
|
7
8
|
environment: Flags.string({
|
|
8
|
-
options: [
|
|
9
|
+
options: [...DEVELOPER_ENVIRONMENTS],
|
|
9
10
|
default: 'test',
|
|
10
11
|
summary: '兼容性预检目标;默认为 test',
|
|
11
12
|
}),
|
|
@@ -13,8 +14,9 @@ export default class Check extends OpenXiangdaCommand {
|
|
|
13
14
|
async run() {
|
|
14
15
|
const { flags } = await this.parse(Check);
|
|
15
16
|
this.beginStudioEvents('check');
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
return this.present(await checkApplication(this.services, {
|
|
18
|
+
...(flags.cwd ? { root: flags.cwd } : {}), environment: flags.environment,
|
|
19
|
+
}));
|
|
18
20
|
}
|
|
19
21
|
}
|
|
20
22
|
//# sourceMappingURL=check.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.js","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"check.js","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEnF,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,kBAAkB;IACnD,MAAM,CAAC,OAAO,GAAG,iBAAiB,CAAC;IACnC,MAAM,CAAC,KAAK,GAAG;QACb,GAAG,oBAAoB;QACvB,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC;YACxB,OAAO,EAAE,CAAC,GAAG,sBAAsB,CAAC;YACpC,OAAO,EAAE,MAAM;YACf,OAAO,EAAE,kBAAkB;SAC5B,CAAC;KACH,CAAC;IAEF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC1C,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,gBAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE;YACxD,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW;SAC1E,CAAC,CAAC,CAAC;IACN,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { OpenXiangdaCommand } from '../base.js';
|
|
2
|
+
export default class Context extends OpenXiangdaCommand {
|
|
3
|
+
static summary: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
cwd: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
+
};
|
|
7
|
+
run(): Promise<import("openxiangda-contracts").DevkitResult<unknown> | {
|
|
8
|
+
schemaVersion: "openxiangda.cli-result/v2";
|
|
9
|
+
ok: boolean;
|
|
10
|
+
operation: string;
|
|
11
|
+
workspace: import("openxiangda-contracts").WorkspaceIdentity | {
|
|
12
|
+
appCode: string;
|
|
13
|
+
name: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
data: {} | null;
|
|
16
|
+
error: {
|
|
17
|
+
details?: Record<string, unknown>;
|
|
18
|
+
pointer?: string;
|
|
19
|
+
code: string;
|
|
20
|
+
message: string;
|
|
21
|
+
retryable: boolean;
|
|
22
|
+
remediation: string;
|
|
23
|
+
nextCommand: string | null;
|
|
24
|
+
} | null;
|
|
25
|
+
} | undefined>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/commands/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAkB,MAAM,YAAY,CAAC;AAEhE,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,kBAAkB;IACrD,MAAM,CAAC,OAAO,SAA0B;IACxC,MAAM,CAAC,KAAK;;MAAkB;IACxB,GAAG;;;;;;;;;;;;;;;;;;;CAIV"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { OpenXiangdaCommand, workspaceFlags } from '../base.js';
|
|
2
|
+
export default class Context extends OpenXiangdaCommand {
|
|
3
|
+
static summary = '只读查看当前工作区、工具链版本与平台绑定';
|
|
4
|
+
static flags = workspaceFlags;
|
|
5
|
+
async run() {
|
|
6
|
+
const { flags } = await this.parse(Context);
|
|
7
|
+
return this.present(await this.services.workspaceContext(flags.cwd));
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/commands/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEhE,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,kBAAkB;IACrD,MAAM,CAAC,OAAO,GAAG,sBAAsB,CAAC;IACxC,MAAM,CAAC,KAAK,GAAG,cAAc,CAAC;IAC9B,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IACvE,CAAC"}
|
|
@@ -6,6 +6,7 @@ export default class Deploy extends OpenXiangdaCommand {
|
|
|
6
6
|
from: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
7
|
"environment-id": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
8
|
"idempotency-key": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
"dry-run": import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
10
|
"json-events": import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
11
|
"run-id": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
12
|
cwd: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAwB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAwB,MAAM,YAAY,CAAC;AAEtE,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,kBAAkB;IACpD,MAAM,CAAC,OAAO,SAA2B;IACzC,MAAM,CAAC,KAAK;;;;;;;;;MAcV;IACI,GAAG;;;;;;;;;;;;;;;;;;;CAkBV"}
|
package/dist/commands/deploy.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Flags } from "@oclif/core";
|
|
2
2
|
import { OpenXiangdaCommand, studioWorkspaceFlags } from "../base.js";
|
|
3
|
+
import { deployApplication, DEVELOPER_ENVIRONMENTS } from 'openxiangda-devkit-core';
|
|
3
4
|
export default class Deploy extends OpenXiangdaCommand {
|
|
4
5
|
static summary = "部署到测试环境,或显式复用测试版本部署生产";
|
|
5
6
|
static flags = {
|
|
6
7
|
...studioWorkspaceFlags,
|
|
7
8
|
environment: Flags.string({
|
|
8
|
-
options: [
|
|
9
|
+
options: [...DEVELOPER_ENVIRONMENTS],
|
|
9
10
|
default: "test",
|
|
10
11
|
summary: "目标环境;默认为 test",
|
|
11
12
|
}),
|
|
@@ -13,24 +14,18 @@ export default class Deploy extends OpenXiangdaCommand {
|
|
|
13
14
|
summary: "生产部署复用的成功测试 DeploymentRun ID",
|
|
14
15
|
dependsOn: ["environment"],
|
|
15
16
|
}),
|
|
16
|
-
"environment-id": Flags.string(),
|
|
17
|
-
"idempotency-key": Flags.string(),
|
|
17
|
+
"environment-id": Flags.string({ summary: '测试环境 ID;通常由绑定自动确定' }),
|
|
18
|
+
"idempotency-key": Flags.string({ summary: '测试部署幂等键;省略时从不可变包摘要派生' }),
|
|
19
|
+
"dry-run": Flags.boolean({ summary: '只读预览部署或生产晋级,不构建、不上传、不提交' }),
|
|
18
20
|
};
|
|
19
21
|
async run() {
|
|
20
22
|
const { flags } = await this.parse(Deploy);
|
|
21
23
|
this.beginStudioEvents("deploy");
|
|
22
|
-
|
|
23
|
-
if (!flags.from) {
|
|
24
|
-
throw new Error("PRODUCTION_TEST_DEPLOYMENT_REQUIRED: 使用 --from <test-deployment-id> 复用已验证版本");
|
|
25
|
-
}
|
|
26
|
-
return this.present(await this.services.deployProduction(flags.cwd, flags.from));
|
|
27
|
-
}
|
|
28
|
-
if (flags.from) {
|
|
29
|
-
throw new Error("DEPLOY_TEST_FROM_INVALID: --from 只允许与 --environment production 一起使用");
|
|
30
|
-
}
|
|
31
|
-
return this.present(await this.services.deploy({
|
|
24
|
+
return this.present(await deployApplication(this.services, {
|
|
32
25
|
...(flags.cwd ? { root: flags.cwd } : {}),
|
|
33
|
-
environment:
|
|
26
|
+
environment: flags.environment,
|
|
27
|
+
...(flags.from ? { from: flags.from } : {}),
|
|
28
|
+
dryRun: flags['dry-run'],
|
|
34
29
|
...(flags["environment-id"]
|
|
35
30
|
? { environmentId: flags["environment-id"] }
|
|
36
31
|
: {}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACtE,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,kBAAkB;IACpD,MAAM,CAAC,OAAO,GAAG,uBAAuB,CAAC;IACzC,MAAM,CAAC,KAAK,GAAG;QACb,GAAG,oBAAoB;QACvB,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC;YACxB,OAAO,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACpF,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,kBAAkB;IACpD,MAAM,CAAC,OAAO,GAAG,uBAAuB,CAAC;IACzC,MAAM,CAAC,KAAK,GAAG;QACb,GAAG,oBAAoB;QACvB,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC;YACxB,OAAO,EAAE,CAAC,GAAG,sBAAsB,CAAC;YACpC,OAAO,EAAE,MAAM;YACf,OAAO,EAAE,eAAe;SACzB,CAAC;QACF,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC;YACjB,OAAO,EAAE,8BAA8B;YACvC,SAAS,EAAE,CAAC,aAAa,CAAC;SA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.js';
|
|
2
|
+
export default class Docs extends OpenXiangdaCommand {
|
|
3
|
+
static summary: string;
|
|
4
|
+
static args: {
|
|
5
|
+
topic: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static flags: {
|
|
8
|
+
section: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
};
|
|
10
|
+
run(): Promise<import("openxiangda-contracts").DevkitResult<unknown> | {
|
|
11
|
+
schemaVersion: "openxiangda.cli-result/v2";
|
|
12
|
+
ok: boolean;
|
|
13
|
+
operation: string;
|
|
14
|
+
workspace: import("openxiangda-contracts").WorkspaceIdentity | {
|
|
15
|
+
appCode: string;
|
|
16
|
+
name: string | undefined;
|
|
17
|
+
};
|
|
18
|
+
data: {} | null;
|
|
19
|
+
error: {
|
|
20
|
+
details?: Record<string, unknown>;
|
|
21
|
+
pointer?: string;
|
|
22
|
+
code: string;
|
|
23
|
+
message: string;
|
|
24
|
+
retryable: boolean;
|
|
25
|
+
remediation: string;
|
|
26
|
+
nextCommand: string | null;
|
|
27
|
+
} | null;
|
|
28
|
+
} | undefined>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=docs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/commands/docs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,kBAAkB;IAClD,MAAM,CAAC,OAAO,SAA6B;IAC3C,MAAM,CAAC,IAAI;;MAAwD;IACnE,MAAM,CAAC,KAAK;;MAAiE;IACvE,GAAG;;;;;;;;;;;;;;;;;;;CAUV"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { documentationIndex, readDocumentation } from 'openxiangda-devkit-core';
|
|
3
|
+
import { OpenXiangdaCommand } from '../base.js';
|
|
4
|
+
export default class Docs extends OpenXiangdaCommand {
|
|
5
|
+
static summary = '读取当前版本的中文使用资料;不传主题时显示目录';
|
|
6
|
+
static args = { topic: Args.string({ summary: '文档目录中的稳定主题 ID' }) };
|
|
7
|
+
static flags = { section: Flags.string({ summary: '主题目录中的章节 ID;按需读取长文档' }) };
|
|
8
|
+
async run() {
|
|
9
|
+
const { args, flags } = await this.parse(Docs);
|
|
10
|
+
if (flags.section && !args.topic)
|
|
11
|
+
throw new Error('DOCUMENTATION_TOPIC_REQUIRED: 读取章节时必须指定主题');
|
|
12
|
+
const data = args.topic ? readDocumentation(args.topic, flags.section) : documentationIndex();
|
|
13
|
+
if (!this.jsonEnabled()) {
|
|
14
|
+
this.log('content' in data ? data.content : data.topics.map(topic => `${topic.id} ${topic.title}`).join('\n'));
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
return this.present({ ok: true, operation: 'docs', workspace: { appCode: 'global', root: process.cwd() }, data, diagnostics: [], nextActions: [] });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=docs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs.js","sourceRoot":"","sources":["../../src/commands/docs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,kBAAkB;IAClD,MAAM,CAAC,OAAO,GAAG,yBAAyB,CAAC;IAC3C,MAAM,CAAC,IAAI,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,CAAC;IACn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ces").Arg<string, Record<string, unknown>>;
|
|
6
6
|
};
|
|
7
7
|
static flags: {
|
|
8
|
+
workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
9
|
destination: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../../src/commands/skill.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../../src/commands/skill.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,kBAAkB;IACnD,MAAM,CAAC,OAAO,SAA2C;IACzD,MAAM,CAAC,IAAI;;MAET;IACF,MAAM,CAAC,KAAK;;;;MAUV;IAEI,GAAG;;;;;;;;;;;;;;;;;;;CA2BV"}
|
package/dist/commands/skill.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { readFileSync } from 'node:fs';
|
|
3
|
+
import { workspaceGuidanceTemplatePath } from 'openxiangda-devkit-core';
|
|
2
4
|
import { homedir } from 'node:os';
|
|
3
5
|
import { join, resolve } from 'node:path';
|
|
4
|
-
import { installSkills, resolveDefaultSkillsRoot, } from 'openxiangda-skill-kit';
|
|
6
|
+
import { installSkills, refreshWorkspaceGuidance, resolveDefaultSkillsRoot, } from 'openxiangda-skill-kit';
|
|
5
7
|
import { OpenXiangdaCommand } from '../base.js';
|
|
6
8
|
export default class Skill extends OpenXiangdaCommand {
|
|
7
9
|
static summary = '安装或更新与当前 openxiangda 版本完全一致的 AI Skill';
|
|
@@ -9,6 +11,7 @@ export default class Skill extends OpenXiangdaCommand {
|
|
|
9
11
|
action: Args.string({ required: true, options: ['install'] }),
|
|
10
12
|
};
|
|
11
13
|
static flags = {
|
|
14
|
+
workspace: Flags.string({ summary: '安装到指定项目的 .agents/skills,并刷新 AGENTS.md 平台区块', helpValue: '<directory>' }),
|
|
12
15
|
destination: Flags.string({
|
|
13
16
|
summary: 'AI Skill 根目录;默认使用 Codex Skill 目录',
|
|
14
17
|
helpValue: '<directory>',
|
|
@@ -24,17 +27,21 @@ export default class Skill extends OpenXiangdaCommand {
|
|
|
24
27
|
throw new Error(`OPENXIANGDA_SKILL_ACTION_UNSUPPORTED:${args.action}`);
|
|
25
28
|
}
|
|
26
29
|
const destination = resolve(flags.destination ||
|
|
30
|
+
(flags.workspace ? join(resolve(flags.workspace), '.agents/skills') : undefined) ||
|
|
27
31
|
join(process.env.CODEX_HOME || join(homedir(), '.codex'), 'skills'));
|
|
28
32
|
const result = await installSkills({
|
|
29
33
|
skillsRoot: resolveDefaultSkillsRoot(),
|
|
30
34
|
destination,
|
|
31
35
|
force: flags.force,
|
|
32
36
|
});
|
|
37
|
+
const guidance = flags.workspace
|
|
38
|
+
? refreshWorkspaceGuidance(resolve(flags.workspace), readFileSync(workspaceGuidanceTemplatePath(), 'utf8'))
|
|
39
|
+
: undefined;
|
|
33
40
|
return this.present({
|
|
34
41
|
ok: true,
|
|
35
42
|
operation: 'skill install',
|
|
36
43
|
workspace: { appCode: 'global', root: process.cwd() },
|
|
37
|
-
data: result,
|
|
44
|
+
data: { ...result, ...(guidance ? { guidance } : {}) },
|
|
38
45
|
diagnostics: [],
|
|
39
46
|
nextActions: [],
|
|
40
47
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill.js","sourceRoot":"","sources":["../../src/commands/skill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,E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AAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE;YACtD,WAAW,EAAE,EAAE;YACf,WAAW,EAAE,EAAE;SAChB,CAAC,CAAC;IACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openxiangda-cli",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.0.0-alpha.179",
|
|
4
|
+
"description": "OpenXiangda 2.0 应用生命周期命令、创建器与模板。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@oclif/core": "4.13.3",
|
|
24
|
-
"openxiangda-contracts": "2.0.0-alpha.
|
|
25
|
-
"openxiangda-devkit-core": "2.0.0-alpha.
|
|
26
|
-
"openxiangda-mcp": "2.0.0-alpha.
|
|
27
|
-
"openxiangda-skill-kit": "2.0.0-alpha.
|
|
24
|
+
"openxiangda-contracts": "2.0.0-alpha.90",
|
|
25
|
+
"openxiangda-devkit-core": "2.0.0-alpha.115",
|
|
26
|
+
"openxiangda-mcp": "2.0.0-alpha.115",
|
|
27
|
+
"openxiangda-skill-kit": "2.0.0-alpha.140"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"tsx": "4.23.12",
|
package/template/AGENTS.md
CHANGED
|
@@ -1,64 +1,23 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 应用开发约定
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
- Use Vite, React Router, Refine Core and platform Field Kit. Use Ant Design for PC and the scoped openxiangda/mobile adapter for touch controls; wrap custom mobile pages in MobileSurface and import openxiangda/mobile/styles.css. Do not import the antd-mobile root with its global reset. Do not author raw business input/select/textarea/contentEditable elements. Keep mobile entrypoints under src/mobile/ or name them Mobile*.tsx / *.mobile.tsx so openxiangda check can inspect their local dependency graph. Do not add Umi, ProComponents or another admin shell.
|
|
6
|
-
- Use Ant Design's default component appearance on PC and the platform's scoped mobile adapter for touch controls. The UI provider supplies Chinese locale and contextual feedback only. Do not generate appearance preferences, color configuration, palette registries, visual state stores or document-wide color effects. Prefer platform components and keep CSS scoped to the component.
|
|
7
|
-
- The template includes Tailwind CSS v4 utilities for user pages. The application owns its minimal document reset; omit preflight from the shared runtime and do not scaffold custom palettes.
|
|
8
|
-
- Bind every generated `appRoutes` entry to its local page with `defineApplicationContributions`; desktop `admin` routes stay inside the platform Shell, while `user` routes render without an admin Shell for independent mobile/user experiences. Generated resource CRUD routes are compiler-owned under `/admin/resources/<resourceCode>...` and `/m/admin/resources/<resourceCode>...`; never recreate root resource paths, aliases or redirects. Explicit routes that have the same canonical shape as another explicit or generated route fail compilation, even when dynamic parameter names differ. Use only the typed `toolbar`, `row` and `detail` resource slots for generated resource actions. Declare the complete editable admin menu with `defineAdminNavigation` and its page/group helpers; the Shell renders only generated `adminNavigation` references and permissions only filter them. Do not create another router, menu store, layout, identity provider, permission store or copied CRUD page; route/action access uses capability or `allOf`/`anyOf`, while Data/App API and Workflow authorization remain server-owned.
|
|
9
|
-
- 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.
|
|
10
|
-
- 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.
|
|
11
|
-
- 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.
|
|
12
|
-
- Define storage with `defineDataModel` in `modules/<business>/models.ts`; compose modules with `defineApplicationModule`. Select standard pages explicitly through `crud`, `defineResourceList` and `defineResourceForm`. Models without `crud` receive no pages or navigation. A business task page may consume several models. The root `openxiangda.config.ts` composes modules, routes and roles; it must not grow into one giant business definition. Existing `data.resources` remains a lower-level input to the same compiler. Keep internal fields `hidden: true`; this is presentation, never authorization. `system: true` marks server-owned values and hides them by default; `hidden: false` may show a business status or serial number. Form/detail/list field selections are exhaustive and ordered. A Workflow subject resource may declare explicit desktop/mobile `detailRouteCode` as documented in the workflow contract.
|
|
13
|
-
- 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`.
|
|
14
|
-
- 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.
|
|
15
|
-
- Standard PC lists use one toolbar, on-demand filters/column settings and drawer create/edit over the retained list. Full-page entry uses the same platform form. Declare shared form/detail groups with `crud[].sections: [{ title, fields }]`; each view's field selection remains exhaustive and ordered. Small forms may omit groups. Keep only business columns by default, use lightweight sections and let platform components handle pending, errors and dirty cancellation. Do not recreate list/form layouts in application code.
|
|
16
|
-
- Add NestJS only for a named business action that needs a cross-resource transaction, an invariant or an external side effect. The blank app contains no apps/server source or Nest dependency importer. Declare backend.enabled or a server operation, then run pnpm openxiangda check or pnpm dev to initialize and install the optional backend once; existing source is never regenerated. Standard platform workflow definitions and activations do not require Nest.
|
|
17
|
-
- One model can declare up to 20 named standard views with `crud[].code` and `name`. Each selects its own list/form/detail fields, sections, generated operations and mobile availability. Bind navigation with `adminResourcePage(modelCode, { viewCode })`; only an unnamed CRUD declaration generates the original default routes. Views share model values, access and Data API ownership. Include writable required fields in create forms or set `generated.create: false`. Keep platform display preferences and authenticated drafts scoped to the selected view; do not copy models or invent a second draft store.
|
|
18
|
-
- Every interactive business action binds `@OpenXiangdaOperation(operation)` and injects `OpenXiangdaBusinessDataApiService`, `OpenXiangdaBusinessNotificationService`, or `OpenXiangdaStandardOperations`. The platform checks the action capability once at App API ingress; the trusted backend then has full Data/managed business-notification access only to its exact application/environment while audit retains the initiating user and action. Do not author `authorizationJSON`, forward user tokens, grant ordinary users `app:notification2:send`, or reapply the user's resource, row and field permissions inside the action.
|
|
19
|
-
- 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.
|
|
20
|
-
- Use the current logged-in user and the union of that user's application roles. An app for every logged-in platform user may declare one existing package role through `authz.authenticatedUserRoleCode`; the platform materializes it on first access and unions it with manual and business-projected roles. Do not fabricate a browser fallback role or use a business membership resource for this universal audience. An optional declared Perspective projects only read visibility (pages, rows and fields); create/update/delete, workflows and custom actions continue to authorize against the complete union. Standard Data API calls inherit `X-OpenXiangda-Perspective` automatically. Use `@CurrentPerspective()` only when custom Nest code reads outside the standard Data API, and apply an equivalent read projection explicitly. Business code must not persist a platform Token or authorization result and must not implement a second identity path.
|
|
21
|
-
- 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.
|
|
22
|
-
- 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.
|
|
23
|
-
- Every `date-range` and `datetime-range` field explicitly declares `rangeBoundary: 'closed' | 'half-open'`. Values remain `{ start, end }`; callers never send or override the boundary. Closed ranges allow `start <= end` and use PostgreSQL `[]`; half-open ranges require `start < end` and use `[)`.
|
|
24
|
-
- 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.
|
|
25
|
-
- 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.
|
|
26
|
-
- 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.
|
|
27
|
-
- 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.
|
|
28
|
-
- `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`.
|
|
29
|
-
- Use `resourceRoleCapabilities(appCode, resourceCode, "read" | "manage" | [operations])` for explicit role grants. A read grant never expands into create/update/delete when a page is added. Confirm the business permission matrix before implementing multi-role behavior; `manage` is only for roles explicitly allowed all CRUD operations. Use `currentUserDataPolicy(...)` for current-user row scope.
|
|
30
|
-
- 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.
|
|
31
|
-
- 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.
|
|
32
|
-
- 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.
|
|
33
|
-
- 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.
|
|
3
|
+
<!-- OPENXIANGDA:BEGIN -->
|
|
4
|
+
## 平台约定
|
|
34
5
|
|
|
35
|
-
|
|
6
|
+
本项目使用 OpenXiangda 2.0。进入项目后以本地精确依赖和锁文件为准,使用 `pnpm openxiangda`;先运行 `context --json` 确认版本和绑定,使用 `docs` 按任务读取当前中文资料。
|
|
36
7
|
|
|
8
|
+
- 模型、页面、导航和权限由应用声明一次;编译器生成契约。业务代码不改生成结果、不创建 platform/data、不复制平台 Router、字段组件、客户端或权限状态。
|
|
9
|
+
- 当前用户、角色并集、数据授权和部署状态归平台;应用不保存凭据或授权快照。普通 CRUD 走 Data API,真实业务动作才按需启用 Nest。
|
|
10
|
+
- 标准业务字段使用 `openxiangda/field-kit`;PC 补充控件使用 antd,移动使用有作用域的 `openxiangda/mobile` 和 MobileSurface,不引入上游全局重置。
|
|
11
|
+
- 无账号表单读取 `docs public-access`,使用 frontend.publicAccess 和专用客户端;标准审批、通知和后端均按需启用。
|
|
12
|
+
- 日常使用 dev 和聚焦测试。只验证时使用 check;授权部署时直接 deploy,它已包含检查、测试和构建。生产必须指定成功测试运行并复用同一版本。
|
|
13
|
+
- 根据变化风险记录业务意图。无行为变化不新建 AppSpec;已有授权和已确认意图不重复向用户请求机械确认。真实角色和浏览器验收与本地测试分别记录。
|
|
14
|
+
- 失败保留错误码、指针和原候选;查询平台状态后使用允许的恢复操作,不自动重放未知结果。
|
|
37
15
|
|
|
38
|
-
|
|
16
|
+
MCP 使用同一项目 CLI:`pnpm exec openxiangda --mcp-stdio --cwd <workspace>`。先读取 workspace_context,再按任务读取 docs_read 和当前契约。登录、创建及长期 dev 使用 CLI/终端。
|
|
39
17
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
selection-dependent toolbar contributions. Preserve hidden fields and query /
|
|
43
|
-
export parity. Column changes preview immediately and save to current-user
|
|
44
|
-
platform preferences explicitly.
|
|
18
|
+
详细用法:`pnpm openxiangda docs development`、`docs frontend`、`docs data-authz`、`docs administration`、`docs testing`、`docs delivery`。按需加载,无需每次通读全部资料。
|
|
19
|
+
<!-- OPENXIANGDA:END -->
|
|
45
20
|
|
|
46
|
-
|
|
47
|
-
do not create application draft tables, localStorage or Nest draft endpoints.
|
|
48
|
-
PC drawer controls are Full screen / New page / Close, with a platform draft
|
|
49
|
-
handoff to the new page. Mobile entry uses grouped touch-field rows, a simple
|
|
50
|
-
title and a fixed action footer, with bottom sheets for drafts and recovery.
|
|
51
|
-
Do not add a mobile Back to list action or desktop form controls. Preserve edit
|
|
52
|
-
revisions and draft CAS; successful submission consumes the draft atomically.
|
|
21
|
+
## 项目自有约定
|
|
53
22
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
For an already deployed standard workflow, first inspect `pnpm openxiangda admin workflow <workflowCode> --json` (add `--environment production` only for production inspection). The platform owns administrator node parameters; local definitions own topology. Do not overwrite runtime overrides during code authoring. Existing tasks retain their frozen parameters and future node entries use the latest configuration.
|
|
57
|
-
|
|
58
|
-
The default scaffold contains Web and shared contracts only. Declare
|
|
59
|
-
`backend: { enabled: true }` or application server capabilities, then use the
|
|
60
|
-
existing `pnpm openxiangda check` / `pnpm dev` loop. The tool initializes Nest
|
|
61
|
-
source and its exact dependencies once, preserves authored source, and retries
|
|
62
|
-
an interrupted dependency install. Standard platform workflow activation does
|
|
63
|
-
not imply application Nest. See `docs/backend.md` and the runnable
|
|
64
|
-
`examples/business-action-extension` for SDK ownership and transaction retries.
|
|
23
|
+
在此补充本项目的业务范围和团队要求;平台资料刷新保留本节内容。
|
package/template/README.md
CHANGED
|
@@ -1,70 +1,45 @@
|
|
|
1
|
-
# OpenXiangda 2.0
|
|
1
|
+
# OpenXiangda 2.0 应用
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
本项目使用精确版本的 openxiangda 根包。默认包含 Web 和共享契约,普通 CRUD、标准审批与通知由平台执行;真实业务动作才按需启用 Nest。
|
|
4
|
+
|
|
5
|
+
## 开始
|
|
4
6
|
|
|
5
7
|
```bash
|
|
8
|
+
pnpm install --frozen-lockfile
|
|
9
|
+
pnpm openxiangda context --json
|
|
6
10
|
pnpm openxiangda dev
|
|
7
11
|
```
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
`appspec/app.md` 是默认保留的业务意图总纲,帮助人和 AI 理解当前需求,但不是发布门禁。没有行为变化
|
|
12
|
-
时不写变更;小改动最多维护一份短 ChangeSpec。按需使用
|
|
13
|
-
`pnpm openxiangda spec context --json`、`spec new` 和 `spec close`,不要引入 1.x `openspec/SDD`。
|
|
13
|
+
依赖已安装时无需重复安装。开发连接已绑定的远端测试数据,终端和页面显示实际环境。缺少账号或绑定时按命令错误提示处理;不要调用旧版全局 CLI。
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
## 阅读资料
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
```bash
|
|
18
|
+
pnpm openxiangda docs
|
|
19
|
+
pnpm openxiangda docs development
|
|
20
|
+
pnpm openxiangda docs application-foundation
|
|
21
|
+
pnpm openxiangda docs frontend
|
|
22
|
+
pnpm openxiangda docs data-authz
|
|
23
|
+
```
|
|
18
24
|
|
|
19
|
-
|
|
25
|
+
资料来自当前根包;长主题支持 --section <章节ID>。AGENTS.md 的平台段说明基本约定,项目自有内容保留在该段之外。AI Skill 按任务读取同源资料。
|
|
20
26
|
|
|
21
|
-
|
|
22
|
-
`frontend.routes`,再用 `defineApplicationContributions(appRoutes, { pages })`
|
|
23
|
-
逐项绑定本地组件并传给 `OpenXiangdaApplication`。后者是唯一的
|
|
24
|
-
BrowserRouter、RuntimeBoundary、Refine、generated routes 和后台 Shell
|
|
25
|
-
所有者;用户页可以拥有独立布局,但不要再建 router/Shell。要使用通用应用待办中心,
|
|
26
|
-
声明 `frontend.user.applicationTodoCenter: true`;平台生成 `/todos` 与 `/m/todos`,
|
|
27
|
-
只读取当前用户的消息/待办投影并统一解析目标页面。
|
|
27
|
+
## 声明与页面
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
默认组件。平台只统一中文语言和消息上下文,不提供外观偏好或配色配置。组件样式应限定
|
|
31
|
-
在自身范围,文档级 margin/height 重置由 `apps/web/src/document.css` 负责。
|
|
29
|
+
业务模型和页面选择保存在 modules,应用根配置负责装配。模型不隐含导航或写授权。字段与标准 CRUD 使用平台组件;PC 控件使用 antd,移动使用 openxiangda/mobile。应用负责最小文档重置和局部样式,不直接导入 antd-mobile 全局重置。
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
不生成额外色板。移动业务输入使用 `openxiangda/mobile` 和平台 Field Kit。
|
|
31
|
+
apps/server 仅在启用后端时初始化。后续 check/dev 保留业务源码,普通 CRUD 不增加 controller。
|
|
35
32
|
|
|
36
|
-
|
|
37
|
-
与移动 `/m/login` 是独立生成的 `authenticationSurfaces`,不计入受保护的
|
|
38
|
-
`appRoutes`。用 `defineApplicationContributions({ routes: appRoutes,
|
|
39
|
-
authenticationSurfaces }, { pages, authentication })` 分别绑定 PC/移动品牌 renderer;
|
|
40
|
-
renderer 只使用 `ApplicationLoginSurfaceProps` 回调,不能验证密码、读取 Token、处理
|
|
41
|
-
OAuth callback 或创建第二个 Router/身份状态。`platformAuthManifest` 单独记录登录面 QA,
|
|
42
|
-
不会改变用户路由覆盖数。
|
|
33
|
+
## 检查与发布
|
|
43
34
|
|
|
44
|
-
|
|
45
|
-
`defineApplicationContributions` 增加完整的 `standardUserSurfaces`:必须同时提供
|
|
46
|
-
`frame.desktop/mobile` 与 `applicationTodoCenter.desktop/mobile`。外框只使用
|
|
47
|
-
`StandardUserPageFrameProps` 的页面类型、安全路由元数据、`children` 和平台返回回调;
|
|
48
|
-
待办 renderer 只使用 `StandardApplicationTodoCenterProps` 的当前用户 items、加载/错误、
|
|
49
|
-
查询、刷新、增量加载、交互和跳转回调。省略该属性继续使用平台默认页面。应用不得接管
|
|
50
|
-
`/todos`、`/m/todos`、Workflow 路由、`RuntimeBoundary`、Token 或 Notification Hub API。
|
|
35
|
+
只检查时运行 `pnpm openxiangda check`;需要发布测试环境时直接运行 `pnpm openxiangda deploy`,它已包含检查、测试和构建。纯前端无需 Docker,启用后端时才构建官方 Dockerfile 镜像。
|
|
51
36
|
|
|
52
|
-
|
|
53
|
-
`/m/admin/resources/<resourceCode>...`;普通根路径和 `/m/...` 产品路径可由显式
|
|
54
|
-
`user` route 使用。生成页内部跳转来自编译后的 `adminPages`,不要手写旧根路径、别名或
|
|
55
|
-
重定向。显式 route 与任一生成 route 的动态路径形状重复时,配置编译会直接失败。
|
|
37
|
+
运行 status/logs 确认平台结果并完成真实角色验收。生产使用 `pnpm openxiangda deploy --environment production --from <成功测试运行ID>`;`--dry-run` 只预览。完整发布、取消、恢复和回滚说明使用 `pnpm openxiangda docs delivery`。
|
|
56
38
|
|
|
57
|
-
|
|
39
|
+
## MCP
|
|
58
40
|
|
|
59
41
|
```bash
|
|
60
|
-
pnpm openxiangda
|
|
61
|
-
pnpm openxiangda deploy
|
|
62
|
-
pnpm openxiangda status
|
|
63
|
-
pnpm openxiangda logs
|
|
42
|
+
pnpm exec openxiangda --mcp-stdio --cwd <项目绝对路径>
|
|
64
43
|
```
|
|
65
44
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
业务录入优先使用 `openxiangda/field-kit`,其余 PC 控件使用 `antd`,移动控件使用 `antd-mobile`。应用源码不能直接写原生 input/select/textarea/contentEditable。移动入口放在 `src/mobile/`,或使用 `Mobile*.tsx` / `*.mobile.tsx`,`openxiangda check` 会连同本地共享依赖一起检查。该检查是开发反馈,不添加运行时安全校验。
|
|
69
|
-
|
|
70
|
-
先在 `appspec/app.md` 记录任务页面和角色矩阵,再生成界面。测试只为业务规则和关键风险建立单元/接口用例;实际 PC、移动端的选择、校验、提交、回显、无权操作由浏览器验收,不能用编译通过或接口 200 替代。
|
|
45
|
+
先读 workspace_context,再按需读取 docs_read 和 contract_describe;升级包后重启连接。登录、创建与长期开发进程继续使用 CLI。
|