ai-project-manage-cli 6.0.69 → 6.0.70
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 +71 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2227,7 +2227,7 @@ function validateAgentWsMessage(value, kind) {
|
|
|
2227
2227
|
// src/commands/connect/deploy-run.ts
|
|
2228
2228
|
import { spawn } from "node:child_process";
|
|
2229
2229
|
import { existsSync as existsSync14, readFileSync as readFileSync12 } from "node:fs";
|
|
2230
|
-
import { join as
|
|
2230
|
+
import { join as join14 } from "node:path";
|
|
2231
2231
|
|
|
2232
2232
|
// src/commands/deploy/internal/wisdom-auto-deploy.ts
|
|
2233
2233
|
import { existsSync as existsSync13, readFileSync as readFileSync11 } from "node:fs";
|
|
@@ -2236,7 +2236,8 @@ import { spawnSync as spawnSync3 } from "node:child_process";
|
|
|
2236
2236
|
|
|
2237
2237
|
// src/commands/deploy/internal/apm-config.ts
|
|
2238
2238
|
import { existsSync as existsSync11, readFileSync as readFileSync9 } from "node:fs";
|
|
2239
|
-
import {
|
|
2239
|
+
import { homedir as homedir2 } from "node:os";
|
|
2240
|
+
import { join as join13, resolve as resolve3 } from "node:path";
|
|
2240
2241
|
function loadApmConfig(options) {
|
|
2241
2242
|
const p = resolve3(
|
|
2242
2243
|
process.cwd(),
|
|
@@ -2375,6 +2376,70 @@ function reqWb(v, field) {
|
|
|
2375
2376
|
}
|
|
2376
2377
|
return v;
|
|
2377
2378
|
}
|
|
2379
|
+
function expandWindowsEnvVars(pathStr, env = process.env) {
|
|
2380
|
+
return pathStr.replace(/%([^%]+)%/g, (_, name) => {
|
|
2381
|
+
const value = env[name];
|
|
2382
|
+
return value ?? `%${name}%`;
|
|
2383
|
+
});
|
|
2384
|
+
}
|
|
2385
|
+
function expandUserPath(pathStr, env = process.env) {
|
|
2386
|
+
const home = env.HOME ?? env.USERPROFILE ?? homedir2();
|
|
2387
|
+
const withEnv = expandWindowsEnvVars(pathStr, env);
|
|
2388
|
+
const expanded = withEnv.replace(/^~(?=\/|\\|$)/, home);
|
|
2389
|
+
if (/^[a-zA-Z]:[/\\]/.test(expanded)) {
|
|
2390
|
+
return expanded;
|
|
2391
|
+
}
|
|
2392
|
+
return resolve3(expanded);
|
|
2393
|
+
}
|
|
2394
|
+
var MAVEN_REPO_ENV_KEYS = [
|
|
2395
|
+
"MAVEN_LOCAL_REPO",
|
|
2396
|
+
"M2_REPO",
|
|
2397
|
+
"MAVEN_REPOSITORY"
|
|
2398
|
+
];
|
|
2399
|
+
function readMavenLocalRepoFromMavenOpts(mavenOpts, env = process.env) {
|
|
2400
|
+
const match = mavenOpts.match(/-Dmaven\.repo\.local=(?:"([^"]+)"|(\S+))/);
|
|
2401
|
+
const raw = match?.[1]?.trim() || match?.[2]?.trim();
|
|
2402
|
+
return raw ? expandUserPath(raw, env) : null;
|
|
2403
|
+
}
|
|
2404
|
+
function readMavenLocalRepoFromEnv(env = process.env) {
|
|
2405
|
+
for (const key of MAVEN_REPO_ENV_KEYS) {
|
|
2406
|
+
const raw = env[key]?.trim();
|
|
2407
|
+
if (raw) {
|
|
2408
|
+
return expandUserPath(raw, env);
|
|
2409
|
+
}
|
|
2410
|
+
}
|
|
2411
|
+
const mavenOpts = env.MAVEN_OPTS?.trim();
|
|
2412
|
+
if (mavenOpts) {
|
|
2413
|
+
return readMavenLocalRepoFromMavenOpts(mavenOpts, env);
|
|
2414
|
+
}
|
|
2415
|
+
return null;
|
|
2416
|
+
}
|
|
2417
|
+
function readMavenLocalRepoFromSettings() {
|
|
2418
|
+
const settingsPath = join13(homedir2(), ".m2", "settings.xml");
|
|
2419
|
+
if (!existsSync11(settingsPath)) {
|
|
2420
|
+
return null;
|
|
2421
|
+
}
|
|
2422
|
+
try {
|
|
2423
|
+
const xml = readFileSync9(settingsPath, "utf8");
|
|
2424
|
+
const match = xml.match(
|
|
2425
|
+
/<localRepository>\s*([^<]+?)\s*<\/localRepository>/
|
|
2426
|
+
);
|
|
2427
|
+
const raw = match?.[1]?.trim();
|
|
2428
|
+
if (!raw) {
|
|
2429
|
+
return null;
|
|
2430
|
+
}
|
|
2431
|
+
return expandUserPath(raw);
|
|
2432
|
+
} catch {
|
|
2433
|
+
return null;
|
|
2434
|
+
}
|
|
2435
|
+
}
|
|
2436
|
+
function resolveMavenLocalRepo(configured) {
|
|
2437
|
+
const trimmed = configured?.trim();
|
|
2438
|
+
if (trimmed) {
|
|
2439
|
+
return expandUserPath(trimmed);
|
|
2440
|
+
}
|
|
2441
|
+
return readMavenLocalRepoFromEnv() ?? readMavenLocalRepoFromSettings() ?? join13(homedir2(), ".m2", "repository");
|
|
2442
|
+
}
|
|
2378
2443
|
function resolveWisdomBackendDeployFromApmConfig(cfg) {
|
|
2379
2444
|
const projectName = reqTopLevelName(cfg);
|
|
2380
2445
|
const w = cfg.wisdomDeploy ?? {};
|
|
@@ -2402,7 +2467,7 @@ function resolveWisdomBackendDeployFromApmConfig(cfg) {
|
|
|
2402
2467
|
remoteLibDir: `${remoteAppDir}/lib`,
|
|
2403
2468
|
startupJar: posixBasename(jarPath),
|
|
2404
2469
|
packageName: `${projectName}.jar.zip`,
|
|
2405
|
-
mavenLocalRepo:
|
|
2470
|
+
mavenLocalRepo: resolveMavenLocalRepo(w.mavenLocalRepo),
|
|
2406
2471
|
healthCheckPort: healthPort,
|
|
2407
2472
|
healthCheckContext: reqHc(h.context, "context").trim(),
|
|
2408
2473
|
healthCheckTimeout: healthTimeout
|
|
@@ -3223,7 +3288,7 @@ async function runWisdomAutoDeploy(options) {
|
|
|
3223
3288
|
// src/commands/connect/deploy-run.ts
|
|
3224
3289
|
var DEPLOY_LOG_SYNC_INTERVAL_MS = 3e4;
|
|
3225
3290
|
function readApmConfig(workdir) {
|
|
3226
|
-
const configPath =
|
|
3291
|
+
const configPath = join14(workspaceApmDir(workdir), "apm.config.json");
|
|
3227
3292
|
if (!existsSync14(configPath)) {
|
|
3228
3293
|
return void 0;
|
|
3229
3294
|
}
|
|
@@ -4133,10 +4198,10 @@ async function runCursorAgent(cfg, ctx, options) {
|
|
|
4133
4198
|
|
|
4134
4199
|
// src/commands/connect/cli-version-sync.ts
|
|
4135
4200
|
import { existsSync as existsSync16, readFileSync as readFileSync14, writeFileSync as writeFileSync12 } from "fs";
|
|
4136
|
-
import { join as
|
|
4201
|
+
import { join as join15 } from "path";
|
|
4137
4202
|
var CLI_VERSION_FILE = ".cli-version.json";
|
|
4138
4203
|
function manifestPath(apmDir) {
|
|
4139
|
-
return
|
|
4204
|
+
return join15(apmDir, CLI_VERSION_FILE);
|
|
4140
4205
|
}
|
|
4141
4206
|
function loadManifest4(apmDir) {
|
|
4142
4207
|
const path12 = toFsPath(manifestPath(apmDir));
|