ai-project-manage-cli 1.0.0
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 +29 -0
- package/dist/api/client.d.ts +14 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +32 -0
- package/dist/api/client.js.map +1 -0
- package/dist/api/http.d.ts +21 -0
- package/dist/api/http.d.ts.map +1 -0
- package/dist/api/http.js +108 -0
- package/dist/api/http.js.map +1 -0
- package/dist/api/index.d.ts +6 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +13 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/request-config.d.ts +16 -0
- package/dist/api/request-config.d.ts.map +1 -0
- package/dist/api/request-config.js +40 -0
- package/dist/api/request-config.js.map +1 -0
- package/dist/api/requirement.d.ts +112 -0
- package/dist/api/requirement.d.ts.map +1 -0
- package/dist/api/requirement.js +6 -0
- package/dist/api/requirement.js.map +1 -0
- package/dist/cli/commands/auth.d.ts +3 -0
- package/dist/cli/commands/auth.d.ts.map +1 -0
- package/dist/cli/commands/auth.js +72 -0
- package/dist/cli/commands/auth.js.map +1 -0
- package/dist/cli/commands/comment.d.ts +3 -0
- package/dist/cli/commands/comment.d.ts.map +1 -0
- package/dist/cli/commands/comment.js +57 -0
- package/dist/cli/commands/comment.js.map +1 -0
- package/dist/cli/commands/config.d.ts +3 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/config.js +59 -0
- package/dist/cli/commands/config.js.map +1 -0
- package/dist/cli/commands/requirement.d.ts +3 -0
- package/dist/cli/commands/requirement.d.ts.map +1 -0
- package/dist/cli/commands/requirement.js +118 -0
- package/dist/cli/commands/requirement.js.map +1 -0
- package/dist/cli/commands/ws.d.ts +3 -0
- package/dist/cli/commands/ws.d.ts.map +1 -0
- package/dist/cli/commands/ws.js +67 -0
- package/dist/cli/commands/ws.js.map +1 -0
- package/dist/cli/credentials.d.ts +25 -0
- package/dist/cli/credentials.d.ts.map +1 -0
- package/dist/cli/credentials.js +52 -0
- package/dist/cli/credentials.js.map +1 -0
- package/dist/cli/exit-api-error.d.ts +2 -0
- package/dist/cli/exit-api-error.d.ts.map +1 -0
- package/dist/cli/exit-api-error.js +12 -0
- package/dist/cli/exit-api-error.js.map +1 -0
- package/dist/cli/session.d.ts +26 -0
- package/dist/cli/session.d.ts.map +1 -0
- package/dist/cli/session.js +41 -0
- package/dist/cli/session.js.map +1 -0
- package/dist/cli/ws-run-command.d.ts +10 -0
- package/dist/cli/ws-run-command.d.ts.map +1 -0
- package/dist/cli/ws-run-command.js +118 -0
- package/dist/cli/ws-run-command.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +38 -0
- package/dist/cli.js.map +1 -0
- package/dist/config-store.d.ts +19 -0
- package/dist/config-store.d.ts.map +1 -0
- package/dist/config-store.js +82 -0
- package/dist/config-store.js.map +1 -0
- package/dist/employee-ws-client.d.ts +42 -0
- package/dist/employee-ws-client.d.ts.map +1 -0
- package/dist/employee-ws-client.js +99 -0
- package/dist/employee-ws-client.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/package.json +46 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerConfigCommands = registerConfigCommands;
|
|
4
|
+
const config_store_1 = require("../../config-store");
|
|
5
|
+
function registerConfigCommands(program) {
|
|
6
|
+
const configCmd = program
|
|
7
|
+
.command("config")
|
|
8
|
+
.description("读写本机配置(npm config 风格)");
|
|
9
|
+
configCmd
|
|
10
|
+
.command("set")
|
|
11
|
+
.argument("key", "base-url | ws-port")
|
|
12
|
+
.argument("value", "服务根地址或 WebSocket 端口(1–65535)")
|
|
13
|
+
.action(async (key, value) => {
|
|
14
|
+
const cfg = await (0, config_store_1.readApmConfig)();
|
|
15
|
+
if (key === "base-url") {
|
|
16
|
+
cfg.baseUrl = (0, config_store_1.normalizeBaseUrl)(value);
|
|
17
|
+
if (!cfg.baseUrl) {
|
|
18
|
+
console.error("base-url 不能为空");
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
else if (key === "ws-port") {
|
|
23
|
+
const n = Number.parseInt(value.trim(), 10);
|
|
24
|
+
if (!Number.isFinite(n) || n < 1 || n > 65535) {
|
|
25
|
+
console.error("ws-port 须为 1–65535 的整数");
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
cfg.wsPort = n;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
console.error("当前仅支持键 base-url、ws-port");
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
await (0, config_store_1.writeApmConfig)(cfg);
|
|
35
|
+
console.log(JSON.stringify({ ok: true }, null, 2));
|
|
36
|
+
});
|
|
37
|
+
configCmd
|
|
38
|
+
.command("get")
|
|
39
|
+
.argument("key", "base-url | ws-port")
|
|
40
|
+
.action(async (key) => {
|
|
41
|
+
const cfg = await (0, config_store_1.readApmConfig)();
|
|
42
|
+
if (key === "base-url") {
|
|
43
|
+
const u = cfg.baseUrl?.trim();
|
|
44
|
+
if (!u) {
|
|
45
|
+
console.error("未配置 base-url");
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
48
|
+
console.log((0, config_store_1.normalizeBaseUrl)(u));
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (key === "ws-port") {
|
|
52
|
+
console.log(String((0, config_store_1.resolveEmployeeWsPortFromConfig)()));
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
console.error("当前仅支持键 base-url、ws-port");
|
|
56
|
+
process.exit(1);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
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O,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUzC,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAQlE"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerRequirementCommands = registerRequirementCommands;
|
|
4
|
+
const promises_1 = require("node:fs/promises");
|
|
5
|
+
const credentials_1 = require("../credentials");
|
|
6
|
+
const exit_api_error_1 = require("../exit-api-error");
|
|
7
|
+
function registerRequirementCommands(program) {
|
|
8
|
+
const req = program
|
|
9
|
+
.command("requirement")
|
|
10
|
+
.description("需求相关子命令(测试用例、分支、缺陷等)");
|
|
11
|
+
registerRequirementTestCaseCommands(req);
|
|
12
|
+
registerRequirementBranchCommands(req);
|
|
13
|
+
registerRequirementDefectCommands(req);
|
|
14
|
+
}
|
|
15
|
+
function registerRequirementTestCaseCommands(req) {
|
|
16
|
+
const reqTc = req.command("test-case").description("测试用例");
|
|
17
|
+
reqTc
|
|
18
|
+
.command("import")
|
|
19
|
+
.description("从 JSON 数组文件批量导入")
|
|
20
|
+
.requiredOption("--requirement-id <id>", "需求 id", (v) => Number.parseInt(v, 10))
|
|
21
|
+
.requiredOption("--file <path>", "UTF-8 JSON 数组,元素字段同单条创建")
|
|
22
|
+
.action(async (opts) => {
|
|
23
|
+
const raw = await (0, promises_1.readFile)(opts.file, "utf8");
|
|
24
|
+
let parsed;
|
|
25
|
+
try {
|
|
26
|
+
parsed = JSON.parse(raw);
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
console.error("JSON 解析失败");
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
if (!Array.isArray(parsed) || parsed.length === 0) {
|
|
33
|
+
console.error("文件须为非空 JSON 数组");
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
const batch = parsed.map((item) => {
|
|
37
|
+
if (!item || typeof item !== "object") {
|
|
38
|
+
throw new Error("数组元素须为对象");
|
|
39
|
+
}
|
|
40
|
+
const o = item;
|
|
41
|
+
return {
|
|
42
|
+
requirementId: opts.requirementId,
|
|
43
|
+
title: String(o.title ?? ""),
|
|
44
|
+
steps: String(o.steps ?? ""),
|
|
45
|
+
expectedResult: o.expectedResult !== undefined && o.expectedResult !== null
|
|
46
|
+
? String(o.expectedResult)
|
|
47
|
+
: undefined,
|
|
48
|
+
status: o.status,
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
const api = (0, credentials_1.apiClient)();
|
|
52
|
+
try {
|
|
53
|
+
const rows = await api.requirement.testCasesCreateBatch(batch);
|
|
54
|
+
console.log(JSON.stringify(rows, null, 2));
|
|
55
|
+
}
|
|
56
|
+
catch (e) {
|
|
57
|
+
(0, exit_api_error_1.exitApiError)(e);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function registerRequirementBranchCommands(req) {
|
|
62
|
+
const reqBranch = req.command("branch").description("需求分支");
|
|
63
|
+
reqBranch
|
|
64
|
+
.command("set-status")
|
|
65
|
+
.description("按需求 ID + 分支名更新分支状态")
|
|
66
|
+
.requiredOption("--requirement-id <id>", "需求 id", (v) => Number.parseInt(v, 10))
|
|
67
|
+
.requiredOption("--branch-name <name>", "远程分支名(精确匹配)")
|
|
68
|
+
.requiredOption("--status <status>", "目标状态")
|
|
69
|
+
.action(async (opts) => {
|
|
70
|
+
const status = opts.status;
|
|
71
|
+
const name = opts.branchName.trim();
|
|
72
|
+
const api = (0, credentials_1.apiClient)();
|
|
73
|
+
try {
|
|
74
|
+
const list = await api.requirement.branchesList({
|
|
75
|
+
requirementId: opts.requirementId,
|
|
76
|
+
});
|
|
77
|
+
const hits = list.filter((b) => b.branchName.trim() === name);
|
|
78
|
+
if (hits.length === 0) {
|
|
79
|
+
console.error(`未找到分支名为「${name}」的记录`);
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
if (hits.length > 1) {
|
|
83
|
+
console.error(`匹配到多条分支「${name}」,拒绝更新`);
|
|
84
|
+
process.exit(1);
|
|
85
|
+
}
|
|
86
|
+
const row = await api.requirement.branchesUpdate({
|
|
87
|
+
id: hits[0].id,
|
|
88
|
+
status,
|
|
89
|
+
});
|
|
90
|
+
console.log(JSON.stringify(row, null, 2));
|
|
91
|
+
}
|
|
92
|
+
catch (e) {
|
|
93
|
+
(0, exit_api_error_1.exitApiError)(e);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function registerRequirementDefectCommands(req) {
|
|
98
|
+
const reqDefect = req.command("defect").description("缺陷");
|
|
99
|
+
reqDefect
|
|
100
|
+
.command("set-status")
|
|
101
|
+
.description("更新缺陷状态")
|
|
102
|
+
.requiredOption("--defect-id <id>", "缺陷 id", (v) => Number.parseInt(v, 10))
|
|
103
|
+
.requiredOption("--status <status>", "目标状态")
|
|
104
|
+
.action(async (opts) => {
|
|
105
|
+
const api = (0, credentials_1.apiClient)();
|
|
106
|
+
try {
|
|
107
|
+
const row = await api.requirement.defectsUpdate({
|
|
108
|
+
id: opts.defectId,
|
|
109
|
+
status: opts.status,
|
|
110
|
+
});
|
|
111
|
+
console.log(JSON.stringify(row, null, 2));
|
|
112
|
+
}
|
|
113
|
+
catch (e) {
|
|
114
|
+
(0, exit_api_error_1.exitApiError)(e);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=requirement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requirement.js","sourceRoot":"","sources":["../../../src/cli/commands/requirement.ts"],"names":[],"mappings":";;AAWA,kEAQC;AAnBD,+CAA4C;AAQ5C,gDAA2C;AAC3C,sDAAiD;AAEjD,SAAgB,2BAA2B,CAAC,OAAgB;IAC1D,MAAM,GAAG,GAAG,OAAO;SAChB,OAAO,CAAC,aAAa,CAAC;SACtB,WAAW,CAAC,sBAAsB,CAA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,CAoEzD"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerWsCommands = registerWsCommands;
|
|
4
|
+
const employee_ws_client_1 = require("../../employee-ws-client");
|
|
5
|
+
const config_store_1 = require("../../config-store");
|
|
6
|
+
const credentials_1 = require("../credentials");
|
|
7
|
+
const ws_run_command_1 = require("../ws-run-command");
|
|
8
|
+
function registerWsCommands(program) {
|
|
9
|
+
program
|
|
10
|
+
.command("ws")
|
|
11
|
+
.description("启动员工 WebSocket 客户端,连接后等待服务端推送(Ctrl+C 退出)")
|
|
12
|
+
.option("-p, --port <port>", "WebSocket 端口(覆盖 apm config 中的 ws-port,优先级最高)", (v) => Number.parseInt(String(v), 10))
|
|
13
|
+
.action((opts) => {
|
|
14
|
+
const c = (0, credentials_1.getActiveCliCredentials)();
|
|
15
|
+
let wsPort;
|
|
16
|
+
if (opts.port !== undefined) {
|
|
17
|
+
if (!Number.isFinite(opts.port) || opts.port < 1 || opts.port > 65535) {
|
|
18
|
+
console.error("--port 须为 1–65535 的整数");
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
wsPort = Math.floor(opts.port);
|
|
22
|
+
}
|
|
23
|
+
(0, ws_run_command_1.ensureAgentReady)();
|
|
24
|
+
const u = new URL((0, config_store_1.normalizeBaseUrl)(c.baseUrl));
|
|
25
|
+
const effectivePort = wsPort ?? (0, config_store_1.resolveEmployeeWsPortFromConfig)();
|
|
26
|
+
const wsProto = u.protocol === "https:" ? "wss:" : "ws:";
|
|
27
|
+
console.error(`连接 ${wsProto}//${u.hostname}:${effectivePort}/ws(员工 id=${c.employeeId})…`);
|
|
28
|
+
const ws = (0, employee_ws_client_1.createEmployeeWebSocket)({
|
|
29
|
+
baseUrl: c.baseUrl,
|
|
30
|
+
token: c.token,
|
|
31
|
+
wsPort,
|
|
32
|
+
onOpen: () => {
|
|
33
|
+
console.error("已连接,等待服务端推送…");
|
|
34
|
+
},
|
|
35
|
+
onMessage: (_raw, parsed) => {
|
|
36
|
+
if (parsed?.event === "cursor") {
|
|
37
|
+
(0, ws_run_command_1.runCursorFromServerPayload)(parsed.data);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (parsed) {
|
|
41
|
+
console.log(JSON.stringify(parsed, null, 2));
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
console.log(_raw);
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
onClose: (code, reason) => {
|
|
48
|
+
console.error(`连接关闭 code=${code} ${reason.toString()}`);
|
|
49
|
+
},
|
|
50
|
+
onError: (err) => {
|
|
51
|
+
console.error(err.message);
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
const shutdown = () => {
|
|
55
|
+
try {
|
|
56
|
+
ws.close();
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
/* ignore */
|
|
60
|
+
}
|
|
61
|
+
process.exit(0);
|
|
62
|
+
};
|
|
63
|
+
process.once("SIGINT", shutdown);
|
|
64
|
+
process.once("SIGTERM", shutdown);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=ws.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ws.js","sourceRoot":"","sources":["../../../src/cli/commands/ws.ts"],"names":[],"mappings":";;AAYA,gDAoEC;AA/ED,iEAAmE;AACnE,qDAG4B;AAC5B,gDAAyD;AACzD,sDAG2B;AAE3B,SAAgB,kBAAkB,CAAC,OAAgB;IACjD,OAAO;SACJ,OAAO,CAAC,IAAI,CAAC;SACb,WAAW,CACV,0CAA0C,CAC3C;SACA,MAAM,CACL,mBAAmB,EACnB,8CAA8C,EAC9C,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACtC;SACA,MAAM,CAAC,CAAC,IAAuB,E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,EAAE,CAAC;oBAC/B,IAAA,2CAA0B,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC;oBACxC,OAAO;gBACT,CAAC;gBACD,IAAI,MAAM,EAAE,CAAC;oBACX,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;gBAC/C,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBACpB,CAAC;YACH,CAAC;YACD,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE;gBACxB,OAAO,CAAC,KAAK,CAAC,aAAa,IAAI,IAAI,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;YAC1D,CAAC;YACD,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;gBACf,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAC7B,CAAC;SACF,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAG,GAAG,EAAE;YACpB,IAAI,CAAC;gBACH,EAAE,CAAC,KAAK,EAAE,CAAC;YACb,CAAC;YAAC,MAAM,CAAC;gBACP,YAAY;YACd,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACjC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type CliCredentials = {
|
|
2
|
+
baseUrl: string;
|
|
3
|
+
token: string;
|
|
4
|
+
employeeId: number;
|
|
5
|
+
};
|
|
6
|
+
/** 由根命令 preAction 在通过校验后调用;config / login / logout 不调用 */
|
|
7
|
+
export declare function setActiveCliCredentials(credentials: CliCredentials | null): void;
|
|
8
|
+
export declare function resolveEffectiveCredentials(): CliCredentials | {
|
|
9
|
+
error: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function getActiveCliCredentials(): CliCredentials;
|
|
12
|
+
export declare function apiClient(): import("listpage-http").ApiClient<{
|
|
13
|
+
readonly auth: {
|
|
14
|
+
readonly loginByEmployee: import("listpage-http").EndpointConfig<import("..").ReqLoginByEmployee, import("..").ResLoginByEmployee>;
|
|
15
|
+
};
|
|
16
|
+
readonly requirement: {
|
|
17
|
+
readonly commentsSubmitPending: import("listpage-http").EndpointConfig<import("..").ReqCommentSubmitPending, import("..").RequirementCommentRow>;
|
|
18
|
+
readonly commentsProcessPendingAndVersion: import("listpage-http").EndpointConfig<import("..").ReqCommentProcessPendingAndVersion, import("..").ResCommentProcessPendingAndVersion>;
|
|
19
|
+
readonly testCasesCreateBatch: import("listpage-http").EndpointConfig<import("..").ReqTestCaseCreate[], import("..").RequirementTestCaseRow[]>;
|
|
20
|
+
readonly branchesList: import("listpage-http").EndpointConfig<import("..").ReqBranchList, import("..").RequirementBranchRow[]>;
|
|
21
|
+
readonly branchesUpdate: import("listpage-http").EndpointConfig<import("..").ReqBranchUpdate, import("..").RequirementBranchRow>;
|
|
22
|
+
readonly defectsUpdate: import("listpage-http").EndpointConfig<import("..").ReqDefectUpdate, import("..").RequirementDefectRow>;
|
|
23
|
+
};
|
|
24
|
+
}>;
|
|
25
|
+
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../src/cli/credentials.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAIF,0DAA0D;AAC1D,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,cAAc,GAAG,IAAI,GACjC,IAAI,CAEN;AAED,wBAAgB,2BAA2B,IACvC,cAAc,GACd;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAmBpB;AAED,wBAAgB,uBAAuB,IAAI,cAAc,CAMxD;AAED,wBAAgB,SAAS;;;;;;;;;;;;GAOxB"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setActiveCliCredentials = setActiveCliCredentials;
|
|
4
|
+
exports.resolveEffectiveCredentials = resolveEffectiveCredentials;
|
|
5
|
+
exports.getActiveCliCredentials = getActiveCliCredentials;
|
|
6
|
+
exports.apiClient = apiClient;
|
|
7
|
+
/**
|
|
8
|
+
* 单次 `apm <子命令>` 进程内:preAction 从配置文件解析出凭证后写入 `activeCliCredentials`,
|
|
9
|
+
* 供本进程内后续多次 HTTP 复用(避免同一条命令里重复读配置)。不是服务端 Session,进程退出即失效。
|
|
10
|
+
*/
|
|
11
|
+
const client_1 = require("../api/client");
|
|
12
|
+
const config_store_1 = require("../config-store");
|
|
13
|
+
let activeCliCredentials = null;
|
|
14
|
+
/** 由根命令 preAction 在通过校验后调用;config / login / logout 不调用 */
|
|
15
|
+
function setActiveCliCredentials(credentials) {
|
|
16
|
+
activeCliCredentials = credentials;
|
|
17
|
+
}
|
|
18
|
+
function resolveEffectiveCredentials() {
|
|
19
|
+
const cfg = (0, config_store_1.readApmConfigSync)();
|
|
20
|
+
const baseUrlRaw = cfg.baseUrl?.trim() || "";
|
|
21
|
+
const baseUrl = baseUrlRaw ? (0, config_store_1.normalizeBaseUrl)(baseUrlRaw) : "";
|
|
22
|
+
const token = cfg.token?.trim() || "";
|
|
23
|
+
const empRaw = cfg.employeeId != null ? String(cfg.employeeId) : "";
|
|
24
|
+
const employeeId = Number.parseInt(empRaw, 10);
|
|
25
|
+
if (!baseUrl) {
|
|
26
|
+
return {
|
|
27
|
+
error: "请配置服务地址:apm config set base-url <url>",
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
if (!token || !Number.isFinite(employeeId) || employeeId < 1) {
|
|
31
|
+
return {
|
|
32
|
+
error: "请执行 apm login,将 token 与 employeeId 写入配置文件",
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return { baseUrl, token, employeeId };
|
|
36
|
+
}
|
|
37
|
+
function getActiveCliCredentials() {
|
|
38
|
+
if (!activeCliCredentials) {
|
|
39
|
+
console.error("内部错误:本命令未在 preAction 中注入凭证");
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
return activeCliCredentials;
|
|
43
|
+
}
|
|
44
|
+
function apiClient() {
|
|
45
|
+
const c = getActiveCliCredentials();
|
|
46
|
+
return (0, client_1.createApmClient)({
|
|
47
|
+
baseUrl: c.baseUrl,
|
|
48
|
+
token: c.token,
|
|
49
|
+
employeeId: c.employeeId,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/cli/credentials.ts"],"names":[],"mappings":";;AAmBA,0DAIC;AAED,kEAqBC;AAED,0DAMC;AAED,8BAOC;AA/DD;;;GAGG;AACH,0CAAgD;AAChD,kDAGyB;AAQzB,IAAI,oBAAoB,GAA0B,IAAI,CAAC;AAEvD,0DAA0D;AAC1D,SAAgB,uBAAuB,CACrC,WAAkC;IAElC,oBAAoB,GAAG,WAAW,CAAC;AACrC,CAAC;AAED,SAAgB,2BAA2B;IAGzC,MAAM,GAAG,GAAG,IAAA,gCAAiB,GAAE,CAAC;IAChC,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC7C,MAAM,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,IAAA,+BAAgB,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/D,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,EAAE,I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|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.exitApiError = exitApiError;
|
|
4
|
+
const listpage_http_1 = require("listpage-http");
|
|
5
|
+
function exitApiError(err) {
|
|
6
|
+
if (err instanceof listpage_http_1.ApiError) {
|
|
7
|
+
console.error(`接口错误 [${err.code}]: ${err.message}`);
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
throw err;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=exit-api-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exit-api-error.js","sourceRoot":"","sources":["../../src/cli/exit-api-error.ts"],"names":[],"mappings":";;AAEA,oCAMC;AARD,iDAAyC;AAEzC,SAAgB,YAAY,CAAC,GAAY;IACvC,IAAI,GAAG,YAAY,wBAAQ,EAAE,CAAC;QAC5B,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,IAAI,MAAM,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,MAAM,GAAG,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type ApmSession = {
|
|
2
|
+
baseUrl: string;
|
|
3
|
+
token: string;
|
|
4
|
+
employeeId: number;
|
|
5
|
+
};
|
|
6
|
+
export declare function setApmSession(session: ApmSession | null): void;
|
|
7
|
+
export declare function resolveEffectiveCredentials(): ApmSession | {
|
|
8
|
+
error: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function getSession(): ApmSession;
|
|
11
|
+
export declare function apiClient(): import("listpage-http").ApiClient<{
|
|
12
|
+
readonly auth: {
|
|
13
|
+
readonly loginByEmployee: import("listpage-http").EndpointConfig<import("..").ReqLoginByEmployee, import("..").ResLoginByEmployee>;
|
|
14
|
+
};
|
|
15
|
+
readonly requirement: {
|
|
16
|
+
readonly versionsList: import("listpage-http").EndpointConfig<import("..").ReqVersionList, import("..").RequirementVersionRow[]>;
|
|
17
|
+
readonly commentsUpdate: import("listpage-http").EndpointConfig<import("..").ReqCommentUpdate, import("..").RequirementCommentRow>;
|
|
18
|
+
readonly versionsCreate: import("listpage-http").EndpointConfig<import("..").ReqVersionCreate, import("..").RequirementVersionRow>;
|
|
19
|
+
readonly testCasesCreateBatch: import("listpage-http").EndpointConfig<import("..").ReqTestCaseCreate[], import("..").RequirementTestCaseRow[]>;
|
|
20
|
+
readonly branchesList: import("listpage-http").EndpointConfig<import("..").ReqBranchList, import("..").RequirementBranchRow[]>;
|
|
21
|
+
readonly branchesUpdate: import("listpage-http").EndpointConfig<import("..").ReqBranchUpdate, import("..").RequirementBranchRow>;
|
|
22
|
+
readonly defectsUpdate: import("listpage-http").EndpointConfig<import("..").ReqDefectUpdate, import("..").RequirementDefectRow>;
|
|
23
|
+
readonly branchesPrReviewCommentsResolve: import("listpage-http").EndpointConfig<import("..").ReqBranchPrReviewAction, import("..").ResBranchPrReviewCommentsResolve>;
|
|
24
|
+
};
|
|
25
|
+
}>;
|
|
26
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/cli/session.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAIF,wBAAgB,aAAa,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI,GAAG,IAAI,CAE9D;AAED,wBAAgB,2BAA2B,IACvC,UAAU,GACV;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAmBpB;AAED,wBAAgB,UAAU,IAAI,UAAU,CAMvC;AAED,wBAAgB,SAAS;;;;;;;;;;;;;;GAOxB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { createApmClient } from "../api/client";
|
|
2
|
+
import { normalizeBaseUrl, readApmConfigSync, } from "../config-store";
|
|
3
|
+
let apmSession = null;
|
|
4
|
+
export function setApmSession(session) {
|
|
5
|
+
apmSession = session;
|
|
6
|
+
}
|
|
7
|
+
export function resolveEffectiveCredentials() {
|
|
8
|
+
const cfg = readApmConfigSync();
|
|
9
|
+
const baseUrlRaw = cfg.baseUrl?.trim() || "";
|
|
10
|
+
const baseUrl = baseUrlRaw ? normalizeBaseUrl(baseUrlRaw) : "";
|
|
11
|
+
const token = cfg.token?.trim() || "";
|
|
12
|
+
const empRaw = cfg.employeeId != null ? String(cfg.employeeId) : "";
|
|
13
|
+
const employeeId = Number.parseInt(empRaw, 10);
|
|
14
|
+
if (!baseUrl) {
|
|
15
|
+
return {
|
|
16
|
+
error: "请配置服务地址:apm config set base-url <url>",
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
if (!token || !Number.isFinite(employeeId) || employeeId < 1) {
|
|
20
|
+
return {
|
|
21
|
+
error: "请执行 apm login,将 token 与 employeeId 写入配置文件",
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
return { baseUrl, token, employeeId };
|
|
25
|
+
}
|
|
26
|
+
export function getSession() {
|
|
27
|
+
if (!apmSession) {
|
|
28
|
+
console.error("内部错误:未解析到 CLI 会话上下文");
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
return apmSession;
|
|
32
|
+
}
|
|
33
|
+
export function apiClient() {
|
|
34
|
+
const s = getSession();
|
|
35
|
+
return createApmClient({
|
|
36
|
+
baseUrl: s.baseUrl,
|
|
37
|
+
token: s.token,
|
|
38
|
+
employeeId: s.employeeId,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/cli/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eA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IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,SAAS;IACvB,MAAM,CAAC,GAAG,UAAU,EAAE,CAAC;IACvB,OAAO,eAAe,CAAC;QACrB,OAAO,EAAE,CAAC,CAAC,OAAO;QAClB,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,UAAU,EAAE,CAAC,CAAC,UAAU;KACzB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 启动 WS 前检测本机 `agent` 是否可用(`agent --version` 成功)。
|
|
3
|
+
*/
|
|
4
|
+
export declare function ensureAgentReady(): void;
|
|
5
|
+
export declare function runCommand(payload: unknown): void;
|
|
6
|
+
/**
|
|
7
|
+
* 处理服务端 `event: cursor` 的 `data`(与 `WsCursorPushData` 一致),在 `cwd` 下执行 `agent …`。
|
|
8
|
+
*/
|
|
9
|
+
export declare function runCursorFromServerPayload(data: unknown): void;
|
|
10
|
+
//# sourceMappingURL=ws-run-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ws-run-command.d.ts","sourceRoot":"","sources":["../../src/cli/ws-run-command.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CA4BvC;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkDjD;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAuC9D"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ensureAgentReady = ensureAgentReady;
|
|
7
|
+
exports.runCommand = runCommand;
|
|
8
|
+
exports.runCursorFromServerPayload = runCursorFromServerPayload;
|
|
9
|
+
const node_child_process_1 = require("node:child_process");
|
|
10
|
+
const node_process_1 = __importDefault(require("node:process"));
|
|
11
|
+
const LOG = "[ws-client]";
|
|
12
|
+
/**
|
|
13
|
+
* 启动 WS 前检测本机 `agent` 是否可用(`agent --version` 成功)。
|
|
14
|
+
*/
|
|
15
|
+
function ensureAgentReady() {
|
|
16
|
+
const r = (0, node_child_process_1.spawnSync)("agent", ["--version"], {
|
|
17
|
+
encoding: "utf8",
|
|
18
|
+
shell: false,
|
|
19
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
20
|
+
});
|
|
21
|
+
if (r.error) {
|
|
22
|
+
console.error(`${LOG} agent 未就绪:${r.error.message}`);
|
|
23
|
+
console.error(`${LOG} 请安装 agent 并确保其位于 PATH 中`);
|
|
24
|
+
node_process_1.default.exit(1);
|
|
25
|
+
}
|
|
26
|
+
if (r.status !== 0) {
|
|
27
|
+
const detail = [r.stderr, r.stdout]
|
|
28
|
+
.filter(Boolean)
|
|
29
|
+
.map((s) => String(s).trim())
|
|
30
|
+
.filter(Boolean)
|
|
31
|
+
.join(" ");
|
|
32
|
+
console.error(`${LOG} agent --version 失败(退出码 ${String(r.status ?? 0)})${detail ? `:${detail}` : ""}`);
|
|
33
|
+
node_process_1.default.exit(1);
|
|
34
|
+
}
|
|
35
|
+
const line = (r.stdout ?? "").toString().trim().split("\n")[0];
|
|
36
|
+
if (line) {
|
|
37
|
+
console.error(`${LOG} agent 已就绪:${line}`);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
console.error(`${LOG} agent 已就绪`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function runCommand(payload) {
|
|
44
|
+
if (!payload || typeof payload !== "object") {
|
|
45
|
+
console.error(`${LOG} invalid command payload`);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const parsed = payload;
|
|
49
|
+
const { command, args, cwd } = parsed;
|
|
50
|
+
if (typeof command !== "string" || !command.trim()) {
|
|
51
|
+
console.error(`${LOG} invalid command payload`);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (!Array.isArray(args) || !args.every((item) => typeof item === "string")) {
|
|
55
|
+
console.error(`${LOG} invalid args payload`);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (typeof cwd !== "string" || !cwd.trim()) {
|
|
59
|
+
console.error(`${LOG} invalid cwd payload`);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
console.error(`${LOG} 执行命令 command=${command} cwd=${cwd}`);
|
|
63
|
+
const child = (0, node_child_process_1.spawn)(command, args, {
|
|
64
|
+
cwd,
|
|
65
|
+
shell: false,
|
|
66
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
67
|
+
});
|
|
68
|
+
child.stdout.on("data", (chunk) => {
|
|
69
|
+
node_process_1.default.stdout.write(`${LOG}[stdout] ${String(chunk)}`);
|
|
70
|
+
});
|
|
71
|
+
child.stderr.on("data", (chunk) => {
|
|
72
|
+
node_process_1.default.stderr.write(`${LOG}[stderr] ${String(chunk)}`);
|
|
73
|
+
});
|
|
74
|
+
child.on("close", (code, signal) => {
|
|
75
|
+
console.log(`${LOG} command done command=${command} code=${String(code)} signal=${String(signal)}`);
|
|
76
|
+
});
|
|
77
|
+
child.on("error", (err) => {
|
|
78
|
+
console.error(`${LOG} command error: ${err.message}`);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* 处理服务端 `event: cursor` 的 `data`(与 `WsCursorPushData` 一致),在 `cwd` 下执行 `agent …`。
|
|
83
|
+
*/
|
|
84
|
+
function runCursorFromServerPayload(data) {
|
|
85
|
+
if (!data || typeof data !== "object") {
|
|
86
|
+
console.error(`${LOG} invalid cursor data`);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const d = data;
|
|
90
|
+
if (typeof d.prompt !== "string" || !d.prompt.trim()) {
|
|
91
|
+
console.error(`${LOG} invalid cursor prompt`);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (typeof d.workdir !== "string" || !d.workdir.trim()) {
|
|
95
|
+
console.error(`${LOG} invalid cursor workdir`);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const prompt = d.prompt.trim();
|
|
99
|
+
const cwd = d.workdir.trim();
|
|
100
|
+
const args = [];
|
|
101
|
+
if (typeof d.model === "string" && d.model.trim()) {
|
|
102
|
+
args.push("--model", d.model.trim());
|
|
103
|
+
}
|
|
104
|
+
if (typeof cwd === "string") {
|
|
105
|
+
args.push("--workspace", cwd);
|
|
106
|
+
}
|
|
107
|
+
if (typeof d.mode === "string") {
|
|
108
|
+
args.push("--mode", d.mode.trim());
|
|
109
|
+
}
|
|
110
|
+
args.push("-f", "--trust", "-p", "--output-format", "text");
|
|
111
|
+
args.push(JSON.stringify(prompt));
|
|
112
|
+
runCommand({
|
|
113
|
+
command: "agent",
|
|
114
|
+
args,
|
|
115
|
+
cwd,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=ws-run-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ws-run-command.js","sourceRoot":"","sources":["../../src/cli/ws-run-command.ts"],"names":[],"mappings":";;;;;AAQA,4CA4BC;AAED,gCAkDC;AAKD,gEAuCC;AApID,2DAAsD;AACtD,gEAAmC;AAEnC,MAAM,GAAG,GAAG,aAAa,CAAC;AAE1B;;GAEG;AACH,SAAgB,gBAAgB;IAC9B,MAAM,CAAC,GAAG,IAAA,8BAAS,EAAC,OAAO,EAAE,CAAC,WAAW,CAAC,EAAE;QAC1C,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;KAClC,CAAC,CAAC;IACH,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;QACZ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