ai-project-manage-cli 7.1.3 → 7.1.4
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/dist/index.js +15 -4
- package/dist/webide-message-worker.js +22 -11
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -6852,6 +6852,16 @@ function withPlanModeToolHint(prompt, mode) {
|
|
|
6852
6852
|
${PLAN_MODE_ASK_QUESTION_HINT}`;
|
|
6853
6853
|
}
|
|
6854
6854
|
|
|
6855
|
+
// src/commands/connect/local-agent-store.ts
|
|
6856
|
+
import { mkdirSync as mkdirSync10 } from "node:fs";
|
|
6857
|
+
import { join as join18 } from "node:path";
|
|
6858
|
+
import { JsonlLocalAgentStore } from "@cursor/sdk";
|
|
6859
|
+
function createWorkspaceLocalAgentStore(workdir) {
|
|
6860
|
+
const rootDir = join18(workdir, ".apm", "cursor-agent-store");
|
|
6861
|
+
mkdirSync10(rootDir, { recursive: true });
|
|
6862
|
+
return new JsonlLocalAgentStore(rootDir);
|
|
6863
|
+
}
|
|
6864
|
+
|
|
6855
6865
|
// src/commands/connect/cursor-agent.ts
|
|
6856
6866
|
setMaxListeners2(100);
|
|
6857
6867
|
installAbortSignalDebug();
|
|
@@ -6885,6 +6895,7 @@ async function obtainAgent(ctx) {
|
|
|
6885
6895
|
model: { id: ctx.model || "default" },
|
|
6886
6896
|
local: {
|
|
6887
6897
|
cwd: ctx.cwd,
|
|
6898
|
+
store: createWorkspaceLocalAgentStore(ctx.workdir),
|
|
6888
6899
|
...ctx.customTools ? { customTools: ctx.customTools } : {}
|
|
6889
6900
|
},
|
|
6890
6901
|
...ctx.mode ? { mode: ctx.mode } : {}
|
|
@@ -7110,10 +7121,10 @@ async function ensureMessageHasReply(cfg, sessionId, messageId, fallback) {
|
|
|
7110
7121
|
|
|
7111
7122
|
// src/commands/connect/cli-version-sync.ts
|
|
7112
7123
|
import { existsSync as existsSync24, readFileSync as readFileSync17, writeFileSync as writeFileSync15 } from "fs";
|
|
7113
|
-
import { join as
|
|
7124
|
+
import { join as join19 } from "path";
|
|
7114
7125
|
var CLI_VERSION_FILE = ".cli-version.json";
|
|
7115
7126
|
function manifestPath(apmDir) {
|
|
7116
|
-
return
|
|
7127
|
+
return join19(apmDir, CLI_VERSION_FILE);
|
|
7117
7128
|
}
|
|
7118
7129
|
function loadManifest4(apmDir) {
|
|
7119
7130
|
const path19 = toFsPath(manifestPath(apmDir));
|
|
@@ -7218,8 +7229,8 @@ function createRunSlotPool(maxConcurrent = DEFAULT_MAX_CONCURRENT, options = {})
|
|
|
7218
7229
|
// src/commands/connect/webide-worker-pool.ts
|
|
7219
7230
|
import { Worker } from "node:worker_threads";
|
|
7220
7231
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
7221
|
-
import { dirname as dirname7, join as
|
|
7222
|
-
var workerFile =
|
|
7232
|
+
import { dirname as dirname7, join as join20 } from "node:path";
|
|
7233
|
+
var workerFile = join20(
|
|
7223
7234
|
dirname7(fileURLToPath3(import.meta.url)),
|
|
7224
7235
|
"webide-message-worker.js"
|
|
7225
7236
|
);
|
|
@@ -1095,6 +1095,16 @@ function withPlanModeToolHint(prompt, mode) {
|
|
|
1095
1095
|
${PLAN_MODE_ASK_QUESTION_HINT}`;
|
|
1096
1096
|
}
|
|
1097
1097
|
|
|
1098
|
+
// src/commands/connect/local-agent-store.ts
|
|
1099
|
+
import { mkdirSync as mkdirSync4 } from "node:fs";
|
|
1100
|
+
import { join as join3 } from "node:path";
|
|
1101
|
+
import { JsonlLocalAgentStore } from "@cursor/sdk";
|
|
1102
|
+
function createWorkspaceLocalAgentStore(workdir) {
|
|
1103
|
+
const rootDir = join3(workdir, ".apm", "cursor-agent-store");
|
|
1104
|
+
mkdirSync4(rootDir, { recursive: true });
|
|
1105
|
+
return new JsonlLocalAgentStore(rootDir);
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1098
1108
|
// src/commands/connect/cursor-agent.ts
|
|
1099
1109
|
setMaxListeners2(100);
|
|
1100
1110
|
installAbortSignalDebug();
|
|
@@ -1128,6 +1138,7 @@ async function obtainAgent(ctx) {
|
|
|
1128
1138
|
model: { id: ctx.model || "default" },
|
|
1129
1139
|
local: {
|
|
1130
1140
|
cwd: ctx.cwd,
|
|
1141
|
+
store: createWorkspaceLocalAgentStore(ctx.workdir),
|
|
1131
1142
|
...ctx.customTools ? { customTools: ctx.customTools } : {}
|
|
1132
1143
|
},
|
|
1133
1144
|
...ctx.mode ? { mode: ctx.mode } : {}
|
|
@@ -1316,7 +1327,7 @@ async function runCursorAgent(cfg, ctx, options) {
|
|
|
1316
1327
|
}
|
|
1317
1328
|
|
|
1318
1329
|
// src/commands/connect/webide-agent-registry.ts
|
|
1319
|
-
import { existsSync as existsSync3, mkdirSync as
|
|
1330
|
+
import { existsSync as existsSync3, mkdirSync as mkdirSync5, readFileSync as readFileSync4, writeFileSync as writeFileSync4 } from "node:fs";
|
|
1320
1331
|
import { dirname as dirname3, resolve as resolve4 } from "node:path";
|
|
1321
1332
|
function registryPath2(workdir, taskId) {
|
|
1322
1333
|
return resolve4(workdir, ".apm", "webide", taskId, "cursor-agent.json");
|
|
@@ -1338,7 +1349,7 @@ function readRegistry2(path) {
|
|
|
1338
1349
|
return {};
|
|
1339
1350
|
}
|
|
1340
1351
|
function writeRegistry2(path, registry) {
|
|
1341
|
-
|
|
1352
|
+
mkdirSync5(dirname3(path), { recursive: true });
|
|
1342
1353
|
writeFileSync4(path, `${JSON.stringify(registry, null, 2)}
|
|
1343
1354
|
`, "utf8");
|
|
1344
1355
|
}
|
|
@@ -1643,11 +1654,11 @@ function resolveMessageReplyFallback(fallback) {
|
|
|
1643
1654
|
}
|
|
1644
1655
|
|
|
1645
1656
|
// src/commands/init.ts
|
|
1646
|
-
import { join as
|
|
1657
|
+
import { join as join6 } from "path";
|
|
1647
1658
|
import { readFileSync as readFileSync6, writeFileSync as writeFileSync7 } from "fs";
|
|
1648
1659
|
|
|
1649
1660
|
// src/deployment-config-sync.ts
|
|
1650
|
-
import { join as
|
|
1661
|
+
import { join as join4 } from "path";
|
|
1651
1662
|
import { writeFileSync as writeFileSync5 } from "fs";
|
|
1652
1663
|
|
|
1653
1664
|
// src/git-remote.ts
|
|
@@ -1838,7 +1849,7 @@ ${diagnostic ?? ""}
|
|
|
1838
1849
|
return { synced: false, repositoryId };
|
|
1839
1850
|
}
|
|
1840
1851
|
const targetApmDir = apmDir ?? workspaceApmDir(workdirPath);
|
|
1841
|
-
const apmConfigPath = toFsPath(
|
|
1852
|
+
const apmConfigPath = toFsPath(join4(targetApmDir, "apm.config.json"));
|
|
1842
1853
|
writeFileSync5(apmConfigPath, `${JSON.stringify(parsed, null, 2)}
|
|
1843
1854
|
`, "utf8");
|
|
1844
1855
|
console.log(`[apm] \u5DF2\u540C\u6B65\u5E73\u53F0\u90E8\u7F72\u914D\u7F6E: ${config.name}`);
|
|
@@ -1854,14 +1865,14 @@ import {
|
|
|
1854
1865
|
rmSync,
|
|
1855
1866
|
writeFileSync as writeFileSync6
|
|
1856
1867
|
} from "fs";
|
|
1857
|
-
import { dirname as dirname4, join as
|
|
1868
|
+
import { dirname as dirname4, join as join5, relative, sep } from "path";
|
|
1858
1869
|
var MANIFEST_FILE = "manifest.json";
|
|
1859
1870
|
function projectDocumentsDir(apmRoot) {
|
|
1860
|
-
return
|
|
1871
|
+
return join5(apmRoot ?? workspaceApmDir(), "project");
|
|
1861
1872
|
}
|
|
1862
1873
|
function projectDocumentLocalPath(apmRoot, documentPath) {
|
|
1863
1874
|
const normalized = normalizeLocalDocumentPath(documentPath);
|
|
1864
|
-
return
|
|
1875
|
+
return join5(projectDocumentsDir(apmRoot), ...normalized.split("/"));
|
|
1865
1876
|
}
|
|
1866
1877
|
function normalizeLocalDocumentPath(path) {
|
|
1867
1878
|
const trimmed = path.trim().replace(/\\/g, "/");
|
|
@@ -1875,7 +1886,7 @@ function normalizeLocalDocumentPath(path) {
|
|
|
1875
1886
|
return segments.join("/");
|
|
1876
1887
|
}
|
|
1877
1888
|
function readLocalManifest(apmRoot) {
|
|
1878
|
-
const manifestPath =
|
|
1889
|
+
const manifestPath = join5(projectDocumentsDir(apmRoot), MANIFEST_FILE);
|
|
1879
1890
|
if (!existsSync4(manifestPath)) {
|
|
1880
1891
|
return null;
|
|
1881
1892
|
}
|
|
@@ -1971,7 +1982,7 @@ ${diagnostic ?? ""}`
|
|
|
1971
1982
|
}
|
|
1972
1983
|
}
|
|
1973
1984
|
writeFileSync6(
|
|
1974
|
-
toFsPath(
|
|
1985
|
+
toFsPath(join5(projectDir, MANIFEST_FILE)),
|
|
1975
1986
|
`${JSON.stringify(remoteManifest, null, 2)}
|
|
1976
1987
|
`,
|
|
1977
1988
|
"utf8"
|
|
@@ -2006,7 +2017,7 @@ async function ensureWorkspaceInitialized(workdir, options) {
|
|
|
2006
2017
|
await syncRepositoryProjectDocumentsPull(workdir, apmDir);
|
|
2007
2018
|
const trimmedName = options?.name?.trim();
|
|
2008
2019
|
if (trimmedName) {
|
|
2009
|
-
const apmConfigPath = toFsPath(
|
|
2020
|
+
const apmConfigPath = toFsPath(join6(apmDir, "apm.config.json"));
|
|
2010
2021
|
const config = readFileSync6(apmConfigPath, "utf8");
|
|
2011
2022
|
const configJson = JSON.parse(config);
|
|
2012
2023
|
configJson.name = trimmedName;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-project-manage-cli",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.4",
|
|
4
4
|
"description": "命令行工具:后续用于调用平台后端 API 完成运维与自动化操作",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@types/ssh2-sftp-client": "~9.0.6"
|
|
30
30
|
},
|
|
31
31
|
"engines": {
|
|
32
|
-
"node": ">=22.
|
|
32
|
+
"node": ">=22.0.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@bufbuild/protobuf": "1.10.0",
|