@chrysb/alphaclaw 0.9.3 → 0.9.5
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/bin/alphaclaw.js +34 -0
- package/lib/scripts/git +6 -0
- package/lib/server/gateway.js +1 -0
- package/lib/server/gog-skill.js +13 -4
- package/lib/server/onboarding/index.js +1 -0
- package/package.json +1 -1
package/bin/alphaclaw.js
CHANGED
|
@@ -508,6 +508,7 @@ if (!kSetupPassword) {
|
|
|
508
508
|
// ---------------------------------------------------------------------------
|
|
509
509
|
|
|
510
510
|
process.env.OPENCLAW_HOME = rootDir;
|
|
511
|
+
process.env.HOME = rootDir;
|
|
511
512
|
process.env.OPENCLAW_CONFIG_PATH = path.join(openclawDir, "openclaw.json");
|
|
512
513
|
process.env.OPENCLAW_STATE_DIR = openclawDir;
|
|
513
514
|
process.env.GOG_KEYRING_PASSWORD =
|
|
@@ -519,6 +520,39 @@ process.env.GOG_KEYRING_PASSWORD =
|
|
|
519
520
|
|
|
520
521
|
process.env.XDG_CONFIG_HOME = openclawDir;
|
|
521
522
|
|
|
523
|
+
const ensureGogCliCompatConfigPath = () => {
|
|
524
|
+
const configDir = path.join(rootDir, ".config");
|
|
525
|
+
const compatPath = path.join(configDir, "gogcli");
|
|
526
|
+
const managedPath = path.join(openclawDir, "gogcli");
|
|
527
|
+
|
|
528
|
+
try {
|
|
529
|
+
fs.mkdirSync(configDir, { recursive: true });
|
|
530
|
+
if (!fs.existsSync(compatPath)) {
|
|
531
|
+
fs.symlinkSync(managedPath, compatPath, "dir");
|
|
532
|
+
console.log(
|
|
533
|
+
`[alphaclaw] Linked gogcli config path ${compatPath} -> ${managedPath}`,
|
|
534
|
+
);
|
|
535
|
+
return;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
const stat = fs.lstatSync(compatPath);
|
|
539
|
+
if (!stat.isSymbolicLink()) return;
|
|
540
|
+
const linkTarget = fs.readlinkSync(compatPath);
|
|
541
|
+
const resolvedTarget = path.resolve(configDir, linkTarget);
|
|
542
|
+
if (resolvedTarget !== managedPath) {
|
|
543
|
+
console.log(
|
|
544
|
+
`[alphaclaw] gogcli config path already exists at ${compatPath}; leaving existing symlink in place`,
|
|
545
|
+
);
|
|
546
|
+
}
|
|
547
|
+
} catch (error) {
|
|
548
|
+
console.log(
|
|
549
|
+
`[alphaclaw] gogcli config path compatibility setup skipped: ${error.message}`,
|
|
550
|
+
);
|
|
551
|
+
}
|
|
552
|
+
};
|
|
553
|
+
|
|
554
|
+
ensureGogCliCompatConfigPath();
|
|
555
|
+
|
|
522
556
|
const gogInstalled = (() => {
|
|
523
557
|
try {
|
|
524
558
|
execSync("command -v gog", { stdio: "ignore" });
|
package/lib/scripts/git
CHANGED
|
@@ -125,6 +125,12 @@ fi
|
|
|
125
125
|
|
|
126
126
|
EFFECTIVE_PWD="$(resolve_effective_pwd "$@")"
|
|
127
127
|
|
|
128
|
+
if [ -z "${GITHUB_TOKEN:-}" ] && in_openclaw_root "$EFFECTIVE_PWD" && [ -f "$OPENCLAW_REPO_ROOT/.env" ]; then
|
|
129
|
+
set -a
|
|
130
|
+
. "$OPENCLAW_REPO_ROOT/.env" >/dev/null 2>&1 || true
|
|
131
|
+
set +a
|
|
132
|
+
fi
|
|
133
|
+
|
|
128
134
|
if [ "${ALPHACLAW_GIT_NO_AUTH:-}" = "1" ] || [ -z "${GITHUB_TOKEN:-}" ] || ! in_openclaw_root "$EFFECTIVE_PWD"; then
|
|
129
135
|
exec "$REAL_GIT" "$@"
|
|
130
136
|
fi
|
package/lib/server/gateway.js
CHANGED
package/lib/server/gog-skill.js
CHANGED
|
@@ -105,6 +105,19 @@ const buildGogSkillContent = ({ fs, accounts }) => {
|
|
|
105
105
|
lines.push("```");
|
|
106
106
|
lines.push("");
|
|
107
107
|
|
|
108
|
+
lines.push("## Runtime Notes");
|
|
109
|
+
lines.push("");
|
|
110
|
+
lines.push(
|
|
111
|
+
"- In AlphaClaw-managed deployments, gog state lives under `$OPENCLAW_STATE_DIR` (typically `/data/.openclaw`).",
|
|
112
|
+
);
|
|
113
|
+
lines.push(
|
|
114
|
+
"- If a direct shell `gog ...` command falls back to `/root/.config/gogcli` or `/root/.openclaw`, rerun it with `XDG_CONFIG_HOME=\"${OPENCLAW_STATE_DIR:-$OPENCLAW_HOME/.openclaw}\"` so gog uses the managed state dir.",
|
|
115
|
+
);
|
|
116
|
+
lines.push(
|
|
117
|
+
"- Always pass `--account <email>` (and `--client <name>` if not \"default\") so gog targets the correct account.",
|
|
118
|
+
);
|
|
119
|
+
lines.push("");
|
|
120
|
+
|
|
108
121
|
// Account table
|
|
109
122
|
lines.push("## Connected Accounts");
|
|
110
123
|
lines.push("");
|
|
@@ -117,10 +130,6 @@ const buildGogSkillContent = ({ fs, accounts }) => {
|
|
|
117
130
|
lines.push(`| ${email} | ${client} | ${services} |`);
|
|
118
131
|
}
|
|
119
132
|
lines.push("");
|
|
120
|
-
lines.push(
|
|
121
|
-
"Always pass `--account <email>` (and `--client <name>` if not \"default\") so gog targets the correct account.",
|
|
122
|
-
);
|
|
123
|
-
lines.push("");
|
|
124
133
|
|
|
125
134
|
// Per-service sections (read from markdown files)
|
|
126
135
|
for (const svc of kServiceOrder) {
|