@lumi-ai-lab/harness-data 0.0.2 → 0.0.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/README.md +3 -0
- package/package.json +1 -1
- package/src/commands/doctor.js +1 -1
- package/src/commands/install.js +4 -2
- package/src/lib/config.js +3 -2
- package/src/lib/prompt.js +10 -4
package/README.md
CHANGED
|
@@ -5,6 +5,7 @@ npx @lumi-ai-lab/harness-data install
|
|
|
5
5
|
npx @lumi-ai-lab/harness-data install --git-protocol ssh
|
|
6
6
|
npx @lumi-ai-lab/harness-data install --git-protocol https
|
|
7
7
|
GITHUB_TOKEN=... npx @lumi-ai-lab/harness-data install --yes --agent codex --git-protocol https --github-token-env GITHUB_TOKEN --cas-config-dir /secure/path/to/cas
|
|
8
|
+
npx @lumi-ai-lab/harness-data install --yes --agent pi --cas-config-dir /secure/path/to/cas
|
|
8
9
|
npx @lumi-ai-lab/harness-data doctor --dir ~/harness-data
|
|
9
10
|
npx @lumi-ai-lab/harness-data update --dir ~/harness-data
|
|
10
11
|
```
|
|
@@ -14,3 +15,5 @@ This package is only the installer and updater. The full Harness Data workspace
|
|
|
14
15
|
Private GitHub repository access defaults to `--git-protocol auto`: SSH is tried first, then HTTPS. HTTPS uses Git Credential Manager, `gh auth login`, or a token supplied through `--github-token-env`; GitHub account passwords are not supported.
|
|
15
16
|
|
|
16
17
|
The `qdm-cmr-cli`, `qdm-indicators-cli`, and `cas-cli` binaries are downloaded from private GitHub Releases in `pengmide/qdm-cmr-cli`, `pengmide/qdm-indicators-cli`, and `pengmide/qdm-cas-cli`. The installer uses `gh auth login` first and falls back to `--github-token-env`.
|
|
18
|
+
|
|
19
|
+
`--agent` supports `claude`, `codex`, `pi`, `both` (Claude + Codex), and `all` (Claude + Codex + Pi).
|
package/package.json
CHANGED
package/src/commands/doctor.js
CHANGED
|
@@ -67,7 +67,7 @@ export async function collectDoctor(workspace, options = {}) {
|
|
|
67
67
|
add("CMR token", await tokenCheck(workspace, "qdm-cmr-cli", env));
|
|
68
68
|
add("Indicators token", await tokenCheck(workspace, "qdm-indicators-cli", env));
|
|
69
69
|
add("wikis index", fs.existsSync(path.join(workspace, ".harness", "index", "wikis-index.json")) || fs.existsSync(path.join(workspace, ".harness", "index", "wikis-runtime-index.json")));
|
|
70
|
-
add("Agent hook", agentOk(workspace, "claude") || agentOk(workspace, "codex"));
|
|
70
|
+
add("Agent hook", agentOk(workspace, "claude") || agentOk(workspace, "codex") || agentOk(workspace, "pi"));
|
|
71
71
|
|
|
72
72
|
return {
|
|
73
73
|
workspace,
|
package/src/commands/install.js
CHANGED
|
@@ -65,9 +65,11 @@ async function configureAuth(workspace, options) {
|
|
|
65
65
|
return casConfigDir;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
async function buildAndCheck(workspace, options) {
|
|
68
|
+
export async function buildAndCheck(workspace, options) {
|
|
69
69
|
const cli = path.join(workspace, "bin", "data-harness-cli");
|
|
70
|
-
|
|
70
|
+
const buildIndexArgs = ["wikis", "build-index"];
|
|
71
|
+
if (options.skipWikisCheck) buildIndexArgs.push("--skip-checks");
|
|
72
|
+
await run(cli, buildIndexArgs, { cwd: workspace, stdio: "inherit" });
|
|
71
73
|
await run(cli, ["context", "--question", "会员复购为什么下降?", "--json"], { cwd: workspace, stdio: "inherit" });
|
|
72
74
|
let runFullCheck = !options.skipWikisCheck;
|
|
73
75
|
if (!options.yes && !options.skipWikisCheck) {
|
package/src/lib/config.js
CHANGED
|
@@ -29,8 +29,9 @@ export function validateCasConfigDir(dir) {
|
|
|
29
29
|
|
|
30
30
|
export function linkAgents(workspace, agent) {
|
|
31
31
|
const pairs = [];
|
|
32
|
-
if (agent === "claude" || agent === "both") pairs.push([".agents/claude", ".claude"]);
|
|
33
|
-
if (agent === "codex" || agent === "both") pairs.push([".agents/codex", ".codex"]);
|
|
32
|
+
if (agent === "claude" || agent === "both" || agent === "all") pairs.push([".agents/claude", ".claude"]);
|
|
33
|
+
if (agent === "codex" || agent === "both" || agent === "all") pairs.push([".agents/codex", ".codex"]);
|
|
34
|
+
if (agent === "pi" || agent === "all") pairs.push([".agents/pi", ".pi"]);
|
|
34
35
|
for (const [sourceRel, targetRel] of pairs) {
|
|
35
36
|
const source = path.join(workspace, sourceRel);
|
|
36
37
|
const target = path.join(workspace, targetRel);
|
package/src/lib/prompt.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import readline from "node:readline/promises";
|
|
2
2
|
import { stdin as input, stdout as output } from "node:process";
|
|
3
3
|
|
|
4
|
+
const agentChoices = ["claude", "codex", "pi", "both", "all"];
|
|
5
|
+
|
|
4
6
|
export async function confirm(message, options = {}) {
|
|
5
7
|
if (options.yes) return true;
|
|
6
8
|
const suffix = options.defaultNo ? " [y/N] " : " [Y/n] ";
|
|
@@ -15,13 +17,17 @@ export async function confirm(message, options = {}) {
|
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
export async function chooseAgent(options = {}) {
|
|
18
|
-
if (options.agent)
|
|
19
|
-
|
|
20
|
+
if (options.agent) {
|
|
21
|
+
const value = String(options.agent).trim().toLowerCase();
|
|
22
|
+
if (!agentChoices.includes(value)) throw new Error("agent must be claude, codex, pi, both, or all");
|
|
23
|
+
return value;
|
|
24
|
+
}
|
|
25
|
+
if (options.yes) throw new Error("non-interactive install requires --agent claude|codex|pi|both|all");
|
|
20
26
|
const rl = readline.createInterface({ input, output });
|
|
21
27
|
try {
|
|
22
|
-
const answer = (await rl.question("Choose Agent: claude, codex, both [codex] ")).trim().toLowerCase();
|
|
28
|
+
const answer = (await rl.question("Choose Agent: claude, codex, pi, both, all [codex] ")).trim().toLowerCase();
|
|
23
29
|
const value = answer || "codex";
|
|
24
|
-
if (!
|
|
30
|
+
if (!agentChoices.includes(value)) throw new Error("agent must be claude, codex, pi, both, or all");
|
|
25
31
|
return value;
|
|
26
32
|
} finally {
|
|
27
33
|
rl.close();
|