openxiangda-cli 2.0.0-alpha.76 → 2.0.0-alpha.78
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 +6 -0
- package/package.json +1 -1
- package/template/AGENTS.md +1 -0
- package/template/apps/web/playwright.config.ts +22 -2
- package/template/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,4 +4,10 @@ OpenXiangda 2.0 installs one developer CLI with exactly eight top-level commands
|
|
|
4
4
|
|
|
5
5
|
The CLI disables user, development and JIT plugin loading. A clean build removes orphaned command output before TypeScript compilation. `--json` emits one stable result envelope and never mixes progress logs into machine output.
|
|
6
6
|
|
|
7
|
+
AI-native development clients use the same pinned executable in pre-command
|
|
8
|
+
stdio mode: `pnpm exec openxiangda --mcp-stdio --cwd <workspace>`. They can read
|
|
9
|
+
`openxiangda://workspace/contracts` or call `contract_describe` to obtain the
|
|
10
|
+
compiler-owned `aiCatalog` and `aiCatalogDigest`. This transport does not add a
|
|
11
|
+
ninth Oclif command and applications must not implement a second MCP server.
|
|
12
|
+
|
|
7
13
|
`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.
|
package/package.json
CHANGED
package/template/AGENTS.md
CHANGED
|
@@ -12,3 +12,4 @@
|
|
|
12
12
|
- A single directory user reference uses a `string` field; a single department or same-app resource reference uses `uuid`; every `multiple: true` reference uses `json`. Roles that consume directory-backed fields explicitly include `app:<app-code>:directory:read`.
|
|
13
13
|
- 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.
|
|
14
14
|
- Run `pnpm openxiangda check` after contract changes. 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.
|
|
15
|
+
- 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`, and require its `aiCatalog` and `aiCatalogDigest` to match the normal compiler output. This is a stdio transport mode, not a ninth CLI command. Never write an application MCP server, Catalog file, preview store or second authorization path.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { defineConfig } from '@playwright/test';
|
|
2
2
|
|
|
3
|
+
const e2ePort = resolveE2ePort();
|
|
3
4
|
const baseURL =
|
|
4
|
-
process.env.OPENXIANGDA_E2E_BASE_URL ||
|
|
5
|
+
process.env.OPENXIANGDA_E2E_BASE_URL || `http://127.0.0.1:${e2ePort}`;
|
|
5
6
|
|
|
6
7
|
export default defineConfig({
|
|
7
8
|
testDir: './e2e',
|
|
@@ -13,9 +14,28 @@ export default defineConfig({
|
|
|
13
14
|
url: baseURL,
|
|
14
15
|
reuseExistingServer: false,
|
|
15
16
|
env: {
|
|
16
|
-
OPENXIANGDA_WEB_PORT:
|
|
17
|
+
OPENXIANGDA_WEB_PORT: String(e2ePort),
|
|
17
18
|
OPENXIANGDA_ENVIRONMENT_KEY: 'production',
|
|
18
19
|
OPENXIANGDA_DEV_PROXY: 'http://127.0.0.1:7001',
|
|
19
20
|
},
|
|
20
21
|
},
|
|
21
22
|
});
|
|
23
|
+
|
|
24
|
+
function resolveE2ePort() {
|
|
25
|
+
const configured = process.env.OPENXIANGDA_E2E_PORT;
|
|
26
|
+
if (configured !== undefined) {
|
|
27
|
+
const port = Number(configured);
|
|
28
|
+
if (!Number.isInteger(port) || port < 1024 || port > 65535) {
|
|
29
|
+
throw new Error(
|
|
30
|
+
'OPENXIANGDA_E2E_PORT must be an integer between 1024 and 65535'
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
return port;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
let hash = 2166136261;
|
|
37
|
+
for (const character of process.cwd()) {
|
|
38
|
+
hash = Math.imul(hash ^ character.charCodeAt(0), 16777619);
|
|
39
|
+
}
|
|
40
|
+
return 30_000 + ((hash >>> 0) % 30_000);
|
|
41
|
+
}
|
package/template/package.json
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"build": "pnpm --recursive build"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"openxiangda-cli": "2.0.0-alpha.
|
|
25
|
+
"openxiangda-cli": "2.0.0-alpha.78",
|
|
26
26
|
"openxiangda-contracts": "2.0.0-alpha.35",
|
|
27
27
|
"openxiangda-devkit-core": "2.0.0-alpha.46",
|
|
28
28
|
"typescript": "5.9.3"
|