@tiens.nguyen/gu-cli 1.0.938 → 1.0.940
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 +17 -7
- package/agent-deps-preflight.mjs +1 -1
- package/autocompact.mjs +2 -2
- package/browser-bridge.mjs +2 -2
- package/browser-chrome.mjs +2 -2
- package/browser-command.mjs +4 -4
- package/browser-extension/README.md +6 -6
- package/clear-logs.mjs +3 -3
- package/clear-state.mjs +3 -3
- package/cli-token.mjs +8 -8
- package/client-expert-api.mjs +9 -9
- package/client-expert-run.mjs +7 -7
- package/client-expert-setup.mjs +4 -4
- package/command-allow.mjs +1 -1
- package/conversation-archive.mjs +2 -2
- package/credential-recovery.mjs +1 -1
- package/daemon-control.mjs +4 -4
- package/device-login.mjs +3 -3
- package/free-model.mjs +35 -3
- package/full-log-command.mjs +1 -1
- package/gonext_agent_chat.py +72 -72
- package/gu-cli.mjs +29 -28
- package/gu-home-move.mjs +193 -0
- package/gu-repl.mjs +72 -54
- package/gu_browser.py +3 -3
- package/gu_free_budget.py +11 -9
- package/gu_gif.py +1 -1
- package/gu_hooks.py +1 -1
- package/gu_mcp.py +22 -2
- package/gu_turn_notes.py +2 -2
- package/hooks-config.mjs +4 -4
- package/image-paste.mjs +8 -8
- package/install-path.mjs +1 -1
- package/log-level.mjs +1 -1
- package/log-policy.mjs +1 -1
- package/lsp-host.mjs +2 -2
- package/lsp-registry.mjs +9 -9
- package/mcp-command.mjs +1 -1
- package/mcp-config.mjs +5 -5
- package/model-doctor.mjs +10 -10
- package/mongo-mac.mjs +2 -2
- package/mongo-windows.mjs +3 -3
- package/package.json +2 -1
- package/platform-tools.mjs +3 -3
- package/poll-errors.mjs +2 -2
- package/prompt_scaffold_check.py +1 -1
- package/proxy-store.mjs +1 -1
- package/python-unix.mjs +6 -6
- package/python-windows.mjs +1 -1
- package/rag-selftest.mjs +2 -2
- package/resume-memory.mjs +1 -1
- package/scripts/image-paste-check.mjs +1 -1
- package/setup-fixes.mjs +4 -4
- package/shell-details.mjs +2 -2
- package/skill-install.mjs +9 -9
- package/skill-package.mjs +10 -10
- package/skill-source.mjs +4 -4
- package/skills-copy.mjs +15 -15
- package/skills.mjs +4 -4
- package/support-bundle.mjs +6 -6
- package/support-report.mjs +5 -5
- package/terminal-layout.mjs +1 -1
- package/turn-notes.mjs +2 -2
- package/version-check.mjs +1 -1
- package/workspace-revert.mjs +2 -2
package/skill-install.mjs
CHANGED
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
* env?: [names asked for at install], notes?: [ … ] }
|
|
20
20
|
*
|
|
21
21
|
* Paths in the manifest and in the packed text files are placeholders, filled in here:
|
|
22
|
-
* {{SKILL}} the skill's folder (one per tool: ~/.
|
|
23
|
-
* {{RUNTIME}} <base>/skill-runtime/<name>, <base> = ~/.
|
|
22
|
+
* {{SKILL}} the skill's folder (one per tool: ~/.gu/skills/<name>, ~/.claude/skills/<name>)
|
|
23
|
+
* {{RUNTIME}} <base>/skill-runtime/<name>, <base> = ~/.gu if gu is a target, else ~/.claude
|
|
24
24
|
* {{PYTHON}} the runtime's own venv python (built here from requirements.txt), else python3
|
|
25
25
|
* {{HOME}} the home folder; {{ENV:NAME}} NAME from the terminal's environment (never packed)
|
|
26
26
|
*
|
|
@@ -290,10 +290,10 @@ function sameTree(files, dir, vars) {
|
|
|
290
290
|
export function planInstall(pkg, { home = homedir(), targets, platform = process.platform, env = process.env } = {}) {
|
|
291
291
|
const { manifest: m } = pkg;
|
|
292
292
|
const name = m.name;
|
|
293
|
-
const found = TARGETS.filter((t) => existsSync(join(home, t === "gu" ? ".
|
|
293
|
+
const found = TARGETS.filter((t) => existsSync(join(home, t === "gu" ? ".gu" : ".claude")));
|
|
294
294
|
const use = targets?.length ? targets : found;
|
|
295
|
-
if (!use.length) throw new Error("neither gu (~/.
|
|
296
|
-
const base = join(home, use.includes("gu") ? ".
|
|
295
|
+
if (!use.length) throw new Error("neither gu (~/.gu) nor Claude Code (~/.claude) is set up here — pass --gu or --claude");
|
|
296
|
+
const base = join(home, use.includes("gu") ? ".gu" : ".claude");
|
|
297
297
|
const runtime = join(base, "skill-runtime", name);
|
|
298
298
|
// platform-ok: only for a package whose command is {{PYTHON}} with no venv — "python" on Windows (not the Store stub's name).
|
|
299
299
|
const python = m.python ? venvPython(runtime, platform) : platform === "win32" ? "python" : "python3";
|
|
@@ -305,20 +305,20 @@ export function planInstall(pkg, { home = homedir(), targets, platform = process
|
|
|
305
305
|
}
|
|
306
306
|
const warnings = [];
|
|
307
307
|
const items = [];
|
|
308
|
-
const runtimeVars = { skill: join(home, ".
|
|
308
|
+
const runtimeVars = { skill: join(home, ".gu", "skills", name), runtime, python, home, env: envValues };
|
|
309
309
|
const runtimeStatus = !pkg.runtime.size ? "same" : sameTree(pkg.runtime, runtime, runtimeVars) ? "same" : existsSync(runtime) ? "differs" : "new";
|
|
310
310
|
if (pkg.runtime.size) items.push({ kind: "runtime", to: runtime, status: runtimeStatus, files: pkg.runtime.size });
|
|
311
311
|
// The venv is (re)built when it is missing or the runtime (so maybe requirements.txt) changed.
|
|
312
312
|
if (m.python) items.push({ kind: "python", to: runtime, requirements: m.python.requirements, status: runtimeStatus === "same" && existsSync(python) ? "same" : "new" });
|
|
313
313
|
for (const t of use) {
|
|
314
|
-
const dot = t === "gu" ? ".
|
|
314
|
+
const dot = t === "gu" ? ".gu" : ".claude";
|
|
315
315
|
const skillDir = join(home, dot, "skills", name);
|
|
316
316
|
const vars = { skill: skillDir, runtime, python, home, env: envValues };
|
|
317
317
|
items.push({ kind: "skill", target: t, to: skillDir, vars, status: sameTree(pkg.skill, skillDir, vars) ? "same" : existsSync(skillDir) ? "differs" : "new" });
|
|
318
318
|
|
|
319
319
|
const servers = isObj(m.mcpServers) ? m.mcpServers : {};
|
|
320
320
|
if (Object.keys(servers).length) {
|
|
321
|
-
const file = t === "gu" ? join(home, ".
|
|
321
|
+
const file = t === "gu" ? join(home, ".gu", "mcp.json") : join(home, ".claude.json");
|
|
322
322
|
const cur = readJsonFile(file);
|
|
323
323
|
if (cur.error) warnings.push(`${file} is ${cur.error} — its MCP servers are left alone`);
|
|
324
324
|
for (const [sname, entry] of Object.entries(servers)) {
|
|
@@ -413,7 +413,7 @@ export function applyInstall(plan, { say = () => {}, run = spawnSync, now = new
|
|
|
413
413
|
try {
|
|
414
414
|
if (it.kind === "runtime" && it.status !== "same") {
|
|
415
415
|
backup(it.to, "runtime");
|
|
416
|
-
writeFiles(it.to, plan.pkg.runtime, { skill: join(plan.home, ".
|
|
416
|
+
writeFiles(it.to, plan.pkg.runtime, { skill: join(plan.home, ".gu", "skills", plan.name), runtime: plan.runtime, python: plan.python, home: plan.home, env: {} });
|
|
417
417
|
done.push(`runtime → ${it.to}`);
|
|
418
418
|
} else if (it.kind === "python" && it.status !== "same") {
|
|
419
419
|
const py = findPython({ run });
|
package/skill-package.mjs
CHANGED
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
* on any machine, for gu and/or Claude Code.
|
|
9
9
|
*
|
|
10
10
|
* What it finds, for the skill folder S (gu's or Claude's, yours or this project's):
|
|
11
|
-
* MCP servers in ~/.
|
|
11
|
+
* MCP servers in ~/.gu/mcp.json and ~/.claude.json whose command/args point inside S or the
|
|
12
12
|
* runtime, or that SKILL.md names
|
|
13
13
|
* the runtime R = the folder the skill's outside files share: absolute paths SKILL.md names
|
|
14
14
|
* plus the servers' files (or --runtime <dir>). Refused when that is too broad
|
|
15
|
-
* (home, ~/.claude, ~/.
|
|
16
|
-
* hooks in ~/.claude/settings.json and ~/.
|
|
15
|
+
* (home, ~/.claude, ~/.gu) or too big
|
|
16
|
+
* hooks in ~/.claude/settings.json and ~/.gu/settings.json whose files are in S or R
|
|
17
17
|
* Python a command that is R's own venv python becomes {{PYTHON}}; R/requirements.txt is
|
|
18
18
|
* then required — the venv itself is never packed, the new machine builds its own
|
|
19
19
|
*
|
|
@@ -122,7 +122,7 @@ export function findSkill(name, { cwd = process.cwd(), home = homedir() } = {})
|
|
|
122
122
|
const want = String(name).replace(/^\//, "");
|
|
123
123
|
const dirs = [];
|
|
124
124
|
for (const source of ["gu", "claude"]) {
|
|
125
|
-
const dot = source === "gu" ? ".
|
|
125
|
+
const dot = source === "gu" ? ".gu" : ".claude";
|
|
126
126
|
if (cwd && resolve(cwd) !== resolve(home)) dirs.push({ dir: join(cwd, dot, "skills"), source, scope: "project" });
|
|
127
127
|
dirs.push({ dir: join(home, dot, "skills"), source, scope: "user" });
|
|
128
128
|
}
|
|
@@ -161,7 +161,7 @@ function commonDir(paths) {
|
|
|
161
161
|
/** Is this folder too broad to be one skill's runtime? */
|
|
162
162
|
function tooBroad(dir, home) {
|
|
163
163
|
const d = resolve(dir);
|
|
164
|
-
return [home, join(home, ".claude"), join(home, ".
|
|
164
|
+
return [home, join(home, ".claude"), join(home, ".gu"), join(home, ".config"), dirname(home), sep].some((x) => resolve(x) === d) || inside(home, d);
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
const refsOf = (entry, home) =>
|
|
@@ -178,17 +178,17 @@ const refsOf = (entry, home) =>
|
|
|
178
178
|
*/
|
|
179
179
|
export function planSkillPack(name, { cwd = process.cwd(), home = homedir(), runtime: runtimeOpt, platform = process.platform } = {}) {
|
|
180
180
|
const sk = findSkill(name, { cwd, home });
|
|
181
|
-
if (!sk) throw new Error(`no skill named "${name}" in ./.
|
|
181
|
+
if (!sk) throw new Error(`no skill named "${name}" in ./.gu/skills, ~/.gu/skills, ./.claude/skills or ~/.claude/skills`);
|
|
182
182
|
const warnings = [];
|
|
183
183
|
const skillTree = packTree(sk.dir);
|
|
184
184
|
const md = skillTree.files.get("SKILL.md").data.toString("utf8");
|
|
185
185
|
|
|
186
186
|
// MCP servers everywhere this machine keeps them.
|
|
187
187
|
const servers = [];
|
|
188
|
-
const guMcp = readJson(join(home, ".
|
|
188
|
+
const guMcp = readJson(join(home, ".gu", "mcp.json"));
|
|
189
189
|
const claude = readJson(join(home, ".claude.json"));
|
|
190
190
|
const proj = isObj(claude.projects) ? claude.projects[resolve(cwd)] : null;
|
|
191
|
-
for (const [where, obj] of [["~/.
|
|
191
|
+
for (const [where, obj] of [["~/.gu/mcp.json", guMcp.mcpServers], ["~/.claude.json", claude.mcpServers], ["~/.claude.json (this folder)", proj?.mcpServers], ["./.mcp.json", readJson(join(cwd, ".mcp.json")).mcpServers]]) {
|
|
192
192
|
for (const [n, e] of Object.entries(isObj(obj) ? obj : {})) if (isObj(e) && e.command) servers.push({ name: n, entry: e, where });
|
|
193
193
|
}
|
|
194
194
|
const named = (n) => new RegExp(`(^|[^A-Za-z0-9_-])${n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}([^A-Za-z0-9_-]|$)`).test(md);
|
|
@@ -244,7 +244,7 @@ export function planSkillPack(name, { cwd = process.cwd(), home = homedir(), run
|
|
|
244
244
|
}
|
|
245
245
|
for (const g of Array.isArray(groups) ? groups : []) addHook(ev, g, "Claude Code");
|
|
246
246
|
}
|
|
247
|
-
const guSettings = readJson(join(home, ".
|
|
247
|
+
const guSettings = readJson(join(home, ".gu", "settings.json"));
|
|
248
248
|
for (const [ev, groups] of Object.entries(isObj(guSettings.hooks) ? guSettings.hooks : {})) {
|
|
249
249
|
for (const g of Array.isArray(groups) ? groups : []) {
|
|
250
250
|
if (!GU_TO_CLAUDE[ev]) continue;
|
|
@@ -425,7 +425,7 @@ export function readmeFor(manifest) {
|
|
|
425
425
|
` in gu: /skill-install ${n}.zip`,
|
|
426
426
|
` without gu: unzip ${n}.zip && node ${zipPath(n, "install.mjs")}`,
|
|
427
427
|
"",
|
|
428
|
-
"It installs for gu (~/.
|
|
428
|
+
"It installs for gu (~/.gu) and Claude Code (~/.claude), whichever is set up on the machine;",
|
|
429
429
|
"--gu or --claude picks one, --dry-run shows the plan without writing anything.",
|
|
430
430
|
...(manifest.env?.length ? ["", `Set these in the terminal first (they were not packed): ${manifest.env.join(", ")}`] : []),
|
|
431
431
|
"",
|
package/skill-source.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WHOSE SKILLS THIS FOLDER USES — gu's or Claude Code's (task #325, /switch-skill).
|
|
3
3
|
*
|
|
4
|
-
* "gu" ~/.
|
|
4
|
+
* "gu" ~/.gu and <project>/.gu (the default; a folder that never chose)
|
|
5
5
|
* "claude" ~/.claude and <project>/.claude Claude Code's own files, read where they are
|
|
6
6
|
*
|
|
7
7
|
* One choice covers skills, MCP servers and hooks, because they depend on each other: a skill names
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
* ONE-WAY. gu reads Claude Code's setup; Claude Code is never expected to read gu's. So nothing of
|
|
12
12
|
* gu's own is written into Claude's files: which project servers and hooks you approved, and the
|
|
13
|
-
* allow rules, stay in ~/.
|
|
13
|
+
* allow rules, stay in ~/.gu whichever source is chosen.
|
|
14
14
|
*
|
|
15
15
|
* PER FOLDER, IN THE FOLDER'S SESSION FILE. The terminal writes it; the worker — a different
|
|
16
16
|
* process, which builds each turn's skills, servers and hooks — reads the same file. Every reader
|
|
@@ -30,7 +30,7 @@ export const SKILL_SOURCE_KEY = "skillSource";
|
|
|
30
30
|
export const normalizeSkillSource = (v) => (v === "claude" ? "claude" : DEFAULT_SKILL_SOURCE);
|
|
31
31
|
|
|
32
32
|
/** The folder each source keeps its files in — under the home directory and under the project. */
|
|
33
|
-
export const sourceDirName = (source) => (normalizeSkillSource(source) === "claude" ? ".claude" : ".
|
|
33
|
+
export const sourceDirName = (source) => (normalizeSkillSource(source) === "claude" ? ".claude" : ".gu");
|
|
34
34
|
|
|
35
35
|
/** What a picker and a status line call it. */
|
|
36
36
|
export const sourceLabel = (source) => (normalizeSkillSource(source) === "claude" ? "Claude's skills" : "gu's skills");
|
|
@@ -38,7 +38,7 @@ export const sourceLabel = (source) => (normalizeSkillSource(source) === "claude
|
|
|
38
38
|
/** The terminal's per-folder session file — the same name gu-repl.mjs uses. */
|
|
39
39
|
export function sessionFileFor(cwd, home = homedir()) {
|
|
40
40
|
const hash = createHash("sha256").update(String(cwd)).digest("hex").slice(0, 32);
|
|
41
|
-
return join(home, ".
|
|
41
|
+
return join(home, ".gu", "sessions", `${hash}.json`);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
/**
|
package/skills-copy.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* /skills-copy-to-claude — copy gu's skills into Claude Code's folders, under Claude's names (#241).
|
|
3
3
|
*
|
|
4
|
-
* ~/.
|
|
5
|
-
* <project>/.
|
|
6
|
-
* the skill's MCP server in ~/.
|
|
4
|
+
* ~/.gu/skills/<name>/ → ~/.claude/skills/<claude-name>/
|
|
5
|
+
* <project>/.gu/skills/<name>/ → <project>/.claude/skills/<claude-name>/
|
|
6
|
+
* the skill's MCP server in ~/.gu/mcp.json → ~/.claude.json
|
|
7
7
|
* (user scope for a home skill, projects["<folder>"] for a project skill)
|
|
8
8
|
*
|
|
9
9
|
* The web-v2 Skills page's installer (#208, src/skills/email/install.mjs) puts a skill's files into
|
|
10
|
-
* ~/.
|
|
10
|
+
* ~/.gu/skills/<name>/ and its MCP server into ~/.gu/mcp.json. This is the same move in the
|
|
11
11
|
* other direction, so a skill set up for gu also works in Claude Code.
|
|
12
12
|
*
|
|
13
13
|
* NAMES. gu's own skills start with "gu-" where Claude's start with "claude-" (the memory skill is
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
* becomes "claude-" in the folder name, the frontmatter `name:` and the text. Other names stay.
|
|
16
16
|
*
|
|
17
17
|
* TEXT. Only SKILL.md is rewritten, and only what is certain: paths into the skill's own folder
|
|
18
|
-
* (they now point at the copy) and the old name. Other mentions of .
|
|
18
|
+
* (they now point at the copy) and the old name. Other mentions of .gu (gu's memory CLI, say)
|
|
19
19
|
* may have no Claude equivalent, so they are left as they are and REPORTED, never guessed.
|
|
20
20
|
*
|
|
21
|
-
* A COPY. Nothing under ~/.
|
|
21
|
+
* A COPY. Nothing under ~/.gu changes. Claude's file ~/.claude.json is changed only through
|
|
22
22
|
* updateClaudeConfig, and only its mcpServers. A Claude skill that differs is kept unless the user
|
|
23
|
-
* chose "replace"; a replaced folder goes to ~/.
|
|
23
|
+
* chose "replace"; a replaced folder goes to ~/.gu/skills-copy-backups/<time>/, never next to
|
|
24
24
|
* the others in .claude/skills, where Claude would load it as a second skill.
|
|
25
25
|
*/
|
|
26
26
|
import { cpSync, existsSync, mkdirSync, readdirSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
@@ -41,12 +41,12 @@ const escapeRe = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* SKILL.md for Claude: its own-folder paths and its old name rewritten. → { text, guLines }
|
|
44
|
-
* guLines = line numbers (1-based) that still mention .
|
|
44
|
+
* guLines = line numbers (1-based) that still mention .gu after the rewrite — for the user to check.
|
|
45
45
|
*/
|
|
46
46
|
export function rewriteSkillText(text, { from, to }) {
|
|
47
47
|
let out = String(text);
|
|
48
|
-
// ".
|
|
49
|
-
const pathRe = new RegExp(`\\.
|
|
48
|
+
// ".gu/skills/<from>" in any form (~/, $HOME/, an absolute home, ./, Windows backslashes).
|
|
49
|
+
const pathRe = new RegExp(`\\.gu([\\\\/])skills\\1${escapeRe(from)}(?![a-z0-9-])`, "g");
|
|
50
50
|
out = out.replace(pathRe, (_m, s) => `.claude${s}skills${s}${to}`);
|
|
51
51
|
if (to !== from) {
|
|
52
52
|
// The name itself: in the frontmatter, as /<name>, in use_skill("<name>")…
|
|
@@ -55,7 +55,7 @@ export function rewriteSkillText(text, { from, to }) {
|
|
|
55
55
|
}
|
|
56
56
|
const guLines = out
|
|
57
57
|
.split("\n")
|
|
58
|
-
.map((l, i) => (/\.
|
|
58
|
+
.map((l, i) => (/\.gu\b/.test(l) ? i + 1 : 0))
|
|
59
59
|
.filter(Boolean);
|
|
60
60
|
return { text: out, guLines };
|
|
61
61
|
}
|
|
@@ -140,14 +140,14 @@ const sameJson = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
|
140
140
|
* warnings, missing: names asked for that gu does not have }
|
|
141
141
|
*/
|
|
142
142
|
export function planSkillsCopy({ cwd = process.cwd(), home = homedir(), names = [], platform = process.platform } = {}) {
|
|
143
|
-
const dirs = [{ scope: "user", from: join(home, ".
|
|
143
|
+
const dirs = [{ scope: "user", from: join(home, ".gu", "skills"), to: join(home, ".claude", "skills") }];
|
|
144
144
|
if (cwd && resolve(cwd) !== resolve(home)) {
|
|
145
|
-
dirs.push({ scope: "project", from: join(cwd, ".
|
|
145
|
+
dirs.push({ scope: "project", from: join(cwd, ".gu", "skills"), to: join(cwd, ".claude", "skills") });
|
|
146
146
|
}
|
|
147
147
|
const gu = readUserConfig(home);
|
|
148
148
|
const claude = readClaudeServers({ cwd, home });
|
|
149
149
|
const warnings = [];
|
|
150
|
-
if (gu.error) warnings.push(`~/.
|
|
150
|
+
if (gu.error) warnings.push(`~/.gu/mcp.json is ${gu.error} — no MCP servers are copied with the skills`);
|
|
151
151
|
if (claude.error) warnings.push(`~/.claude.json is ${claude.error} — no MCP servers can be copied into it`);
|
|
152
152
|
|
|
153
153
|
const wanted = new Set(names.map((n) => String(n).replace(/^\//, "")));
|
|
@@ -216,7 +216,7 @@ function moveDir(from, to) {
|
|
|
216
216
|
*/
|
|
217
217
|
export function applySkillsCopy(plan, { replace = false, cwd = process.cwd(), home = homedir(), now = new Date() } = {}) {
|
|
218
218
|
const stamp = now.toISOString().replace(/[:.]/g, "-");
|
|
219
|
-
const backupRoot = join(home, ".
|
|
219
|
+
const backupRoot = join(home, ".gu", BACKUP_DIR_NAME, stamp);
|
|
220
220
|
const done = [];
|
|
221
221
|
const servers = [];
|
|
222
222
|
const errors = [];
|
package/skills.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SKILLS — folders with a SKILL.md, the way Claude Code does them (task #269).
|
|
3
3
|
*
|
|
4
|
-
* ~/.
|
|
5
|
-
* <project>/.
|
|
4
|
+
* ~/.gu/skills/<name>/SKILL.md yours, every folder
|
|
5
|
+
* <project>/.gu/skills/<name>/SKILL.md this project only
|
|
6
6
|
*
|
|
7
7
|
* …or Claude Code's own, when the folder chose them with /switch-skill (#325, skill-source.mjs):
|
|
8
8
|
* ~/.claude/skills/<name>/SKILL.md and <project>/.claude/skills/<name>/SKILL.md
|
|
@@ -37,9 +37,9 @@ export const SKILL_NAME_RE = /^[a-z0-9][a-z0-9-]{0,63}$/;
|
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* CORE SKILLS (GH #344): skills that ship INSIDE the package, <package>/skills/core/<name>/SKILL.md.
|
|
40
|
-
* They are read from there on every scan and never copied into ~/.
|
|
40
|
+
* They are read from there on every scan and never copied into ~/.gu/skills, so `npm i -g`
|
|
41
41
|
* is enough (no postinstall to fail under --ignore-scripts), an upgrade upgrades them, and
|
|
42
|
-
* `rm -rf ~/.
|
|
42
|
+
* `rm -rf ~/.gu/skills` cannot remove them. They belong to gu, not to a skills folder, so they
|
|
43
43
|
* load whichever source /switch-skill chose.
|
|
44
44
|
*
|
|
45
45
|
* ORDER: project < core < yours. A personal skill with a core skill's name replaces it, visibly
|
package/support-bundle.mjs
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* list, never by a sweep: conversations (sessions/), keys (worker.env) and RAG data are not
|
|
11
11
|
* logs and never go. Also the Windows installer's log and the newest npm debug logs that
|
|
12
12
|
* mention gu, because an install that failed has no gu logs at all.
|
|
13
|
-
* 2. zipFiles — one .zip in ~/.
|
|
13
|
+
* 2. zipFiles — one .zip in ~/.gu/support/, owner-only. Pure JS: no `zip`/`tar` on PATH needed.
|
|
14
14
|
* 3. sendSupportRequest — POST /api/support/requests (the same queue the web Support page fills)
|
|
15
15
|
* → a GU-XXXXXX reference and a one-time upload key, then the zip to …/:ref/logs.
|
|
16
16
|
* 4. When sending fails, the zip stays and supportFallbackLines says where to email it.
|
|
@@ -31,7 +31,7 @@ export const SUPPORT_EMAIL = "tien@getmarsic.cc";
|
|
|
31
31
|
/** The hosted API — the one device login and the free token use (device-login.mjs DEFAULT_API_BASE). */
|
|
32
32
|
export const SUPPORT_API_BASE = "https://chat-api-v2.gucli.com";
|
|
33
33
|
export const SUPPORT_DIR = "support";
|
|
34
|
-
/** Old bundles kept in ~/.
|
|
34
|
+
/** Old bundles kept in ~/.gu/support — they are ours to remove, and each holds logs. */
|
|
35
35
|
export const KEEP_BUNDLES = 5;
|
|
36
36
|
|
|
37
37
|
export const LIMITS = {
|
|
@@ -106,7 +106,7 @@ export function npmLogDirs({ home = homedir(), env = process.env } = {}) {
|
|
|
106
106
|
* of a gu install, the newest run logs, then rotations. → [{ name, path }] (name = path in the zip).
|
|
107
107
|
*/
|
|
108
108
|
export async function listSupportSources({ home = homedir(), env = process.env, tmp = tmpdir(), limits = LIMITS } = {}) {
|
|
109
|
-
const root = join(home, ".
|
|
109
|
+
const root = join(home, ".gu");
|
|
110
110
|
const out = [];
|
|
111
111
|
let names = [];
|
|
112
112
|
try {
|
|
@@ -245,7 +245,7 @@ const stamp = (d) => d.toISOString().replace(/[-:]/g, "").replace("T", "-").slic
|
|
|
245
245
|
|
|
246
246
|
/**
|
|
247
247
|
* Build the bundle: the health report + the masked logs, zipped, saved owner-only in
|
|
248
|
-
* ~/.
|
|
248
|
+
* ~/.gu/support/. Shrinks the per-file cut until the zip fits what the API takes.
|
|
249
249
|
* → { file, bytes, zip, files: [{ name, size, cut }], skipped, reportLines }
|
|
250
250
|
*/
|
|
251
251
|
export async function prepareSupportBundle(opts = {}) {
|
|
@@ -275,7 +275,7 @@ export async function prepareSupportBundle(opts = {}) {
|
|
|
275
275
|
if (zip.length <= limits.zip || perFile < 16 * 1024) break;
|
|
276
276
|
perFile = Math.floor(perFile / 2);
|
|
277
277
|
}
|
|
278
|
-
const dir = join(home, ".
|
|
278
|
+
const dir = join(home, ".gu", SUPPORT_DIR);
|
|
279
279
|
await mkdir(dir, { recursive: true });
|
|
280
280
|
const file = join(dir, `gu-support-${stamp(now)}.zip`);
|
|
281
281
|
await writeFile(file, built.zip, { mode: 0o600 });
|
|
@@ -367,7 +367,7 @@ export function supportFallbackLines({ ref = "", file = "", why = "" } = {}) {
|
|
|
367
367
|
export async function defaultReplyEmail({ home = homedir(), env = process.env, token = null } = {}) {
|
|
368
368
|
try {
|
|
369
369
|
const ct = token ?? (await import("./cli-token.mjs"));
|
|
370
|
-
const st = await ct.readState(join(home, ".
|
|
370
|
+
const st = await ct.readState(join(home, ".gu"));
|
|
371
371
|
if (!st?.token) return "";
|
|
372
372
|
const check = ct.verifyCliToken(st.token, ct.publicKey(env));
|
|
373
373
|
return check.ok && ct.isEmail(check.payload?.email) ? String(check.payload.email).trim() : "";
|
package/support-report.mjs
CHANGED
|
@@ -52,7 +52,7 @@ export async function buildSupportReport({
|
|
|
52
52
|
api = null, // the client-expert-api module, injectable
|
|
53
53
|
run = null, // the client-expert-run module, injectable
|
|
54
54
|
} = {}) {
|
|
55
|
-
const dir = join(home, ".
|
|
55
|
+
const dir = join(home, ".gu");
|
|
56
56
|
const out = [];
|
|
57
57
|
const section = (t) => out.push("", `== ${t} ==`);
|
|
58
58
|
const line = (l) => out.push(l);
|
|
@@ -130,7 +130,7 @@ export async function buildSupportReport({
|
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
132
|
|
|
133
|
-
section("Files in ~/.
|
|
133
|
+
section("Files in ~/.gu");
|
|
134
134
|
await safe("files", async () => {
|
|
135
135
|
const names = (await readdir(dir).catch(() => [])).sort();
|
|
136
136
|
if (!names.length) line("(folder is empty or absent — a totally fresh install)");
|
|
@@ -150,12 +150,12 @@ export async function buildSupportReport({
|
|
|
150
150
|
return out.map(redactReport);
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
/** Build, write ~/.
|
|
153
|
+
/** Build, write ~/.gu/support-report.txt (owner-only) and return { lines, file }. */
|
|
154
154
|
export async function writeSupportReport(opts = {}) {
|
|
155
155
|
const home = opts.home ?? homedir();
|
|
156
156
|
const lines = await buildSupportReport(opts);
|
|
157
|
-
const file = join(home, ".
|
|
158
|
-
await mkdir(join(home, ".
|
|
157
|
+
const file = join(home, ".gu", SUPPORT_REPORT_FILE);
|
|
158
|
+
await mkdir(join(home, ".gu"), { recursive: true });
|
|
159
159
|
await writeFile(file, lines.join("\n") + "\n", { encoding: "utf8", mode: 0o600 });
|
|
160
160
|
return { lines, file };
|
|
161
161
|
}
|
package/terminal-layout.mjs
CHANGED
|
@@ -1821,7 +1821,7 @@ export function workspaceScopeWarning(cwd, home) {
|
|
|
1821
1821
|
* answerable without a terminal.
|
|
1822
1822
|
*/
|
|
1823
1823
|
export const RAG_STORAGE = [
|
|
1824
|
-
{ id: "local", label: "local", note: "on this machine only (~/.
|
|
1824
|
+
{ id: "local", label: "local", note: "on this machine only (~/.gu) — no AWS keys needed" },
|
|
1825
1825
|
{ id: "cloud", label: "cloud", note: "on your S3 bucket only — same index as the web app; needs RAG AWS keys" },
|
|
1826
1826
|
{ id: "both", label: "local + cloud", note: "local is read; each shard also mirrored to S3 — needs RAG AWS keys" },
|
|
1827
1827
|
];
|
package/turn-notes.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// NOTES FOR THE RUNNING TURN (GH #506, shown like chat messages since #514).
|
|
2
2
|
//
|
|
3
3
|
// Enter during a turn used to QUEUE the question for after the turn (#429). Now it is written to
|
|
4
|
-
// ~/.
|
|
4
|
+
// ~/.gu/turn-notes/<jobId>.jsonl, and the agent (gu_turn_notes.py) adds it after its current
|
|
5
5
|
// step's result, so the model reads it at its NEXT step — appended at the end of the conversation,
|
|
6
6
|
// which keeps the prompt cache. A note the agent did not take by the end of the turn (the turn was
|
|
7
7
|
// a plain reply, or ended on that very step) is taken back here and runs as the next question.
|
|
@@ -11,7 +11,7 @@ import { appendFileSync, existsSync, mkdirSync, readdirSync, readFileSync, renam
|
|
|
11
11
|
import { homedir } from "node:os";
|
|
12
12
|
import { join } from "node:path";
|
|
13
13
|
|
|
14
|
-
export const notesDir = (home = homedir()) => join(home, ".
|
|
14
|
+
export const notesDir = (home = homedir()) => join(home, ".gu", "turn-notes");
|
|
15
15
|
const safe = (jobId) => String(jobId ?? "").replace(/[^A-Za-z0-9_-]/g, "").slice(0, 80);
|
|
16
16
|
export const notesPath = (jobId, home) => join(notesDir(home), `${safe(jobId)}.jsonl`);
|
|
17
17
|
|
package/version-check.mjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* TWO THINGS GO STALE INDEPENDENTLY (task #181) and neither was ever checked:
|
|
5
5
|
* · the CLI — @tiens.nguyen/gu-cli on npm
|
|
6
|
-
* · the API — the Client Expert package on S3, per ~/.
|
|
6
|
+
* · the API — the Client Expert package on S3, per ~/.gu/api/<version>/
|
|
7
7
|
*
|
|
8
8
|
* They share nothing but the question. The CLI's answer means "restart gu"; the API's means
|
|
9
9
|
* "restart the local API, dropping whatever it was serving". So only the COMPARISON lives here,
|
package/workspace-revert.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* UNDO AN AGENT RUN'S FILE CHANGES — shared by `gu-cli workspace revert` and the terminal's /undo
|
|
3
3
|
* (task #302).
|
|
4
4
|
*
|
|
5
|
-
* Every agent run keeps ~/.
|
|
5
|
+
* Every agent run keeps ~/.gu/workspace-backups/<runId>/: a copy of each file taken before its
|
|
6
6
|
* FIRST edit in that run, and manifest.json listing every change (gonext_agent_chat.py
|
|
7
7
|
* _ws_snapshot / _ws_record_change). Undo puts the ORIGINAL state back.
|
|
8
8
|
*
|
|
@@ -18,7 +18,7 @@ import { copyFile, readFile, rmdir, unlink } from "node:fs/promises";
|
|
|
18
18
|
import { homedir } from "node:os";
|
|
19
19
|
import { join } from "node:path";
|
|
20
20
|
|
|
21
|
-
export const BACKUPS_ROOT = join(homedir(), ".
|
|
21
|
+
export const BACKUPS_ROOT = join(homedir(), ".gu", "workspace-backups");
|
|
22
22
|
|
|
23
23
|
/** The manifest's changes → one step per path, from its earliest entry. Pure. */
|
|
24
24
|
export function planRevert(changes) {
|