@pushary/agent-hooks 0.62.3 → 0.62.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/CHANGELOG.md +26 -0
- package/dist/bin/pushary-clean.js +27 -15
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.62.4
|
|
4
|
+
|
|
5
|
+
### `pushary clean` crashed partway through on Node 24
|
|
6
|
+
|
|
7
|
+
`clean` threw `ERR_INVALID_ARG_TYPE: The "options.force" property must be of
|
|
8
|
+
type boolean` and died mid-run, after cleaning some agents and before touching
|
|
9
|
+
the rest. Introduced in 0.62.0 by the `--dry-run` work, which started passing
|
|
10
|
+
`force: undefined` to `rmSync` on every call that omitted the option. Older Node
|
|
11
|
+
ignored that; Node 24 rejects it.
|
|
12
|
+
|
|
13
|
+
If a clean died on you, re-run it. It is safe to run repeatedly and picks up
|
|
14
|
+
whatever is left.
|
|
15
|
+
|
|
16
|
+
The three mutation primitives behind `--dry-run` now live in `src/cli/dry-run.ts`
|
|
17
|
+
instead of inside the command file. Both `--dry-run` defects that reached users
|
|
18
|
+
were in those few lines, and both got past tests that could only read the source
|
|
19
|
+
as text, because code in `bin/` runs at import and cannot be called by a test.
|
|
20
|
+
They are ordinary functions with ordinary tests now.
|
|
21
|
+
|
|
22
|
+
### The authorize page's code input overflowed its card
|
|
23
|
+
|
|
24
|
+
The eight character slots were a fixed width, so they added up to 488px inside a
|
|
25
|
+
384px card and spilled out of both edges. They now share the row and shrink to
|
|
26
|
+
fit, down to a 320px phone.
|
|
27
|
+
|
|
28
|
+
|
|
3
29
|
## 0.62.3
|
|
4
30
|
|
|
5
31
|
### `setup --connect app --key ...` discarded your key
|
|
@@ -30,12 +30,32 @@ import "../chunk-DQAN3JQP.js";
|
|
|
30
30
|
import "../chunk-KZERVKTD.js";
|
|
31
31
|
|
|
32
32
|
// bin/pushary-clean.ts
|
|
33
|
-
import { existsSync, readFileSync,
|
|
33
|
+
import { existsSync, readFileSync, copyFileSync, readdirSync } from "fs";
|
|
34
34
|
import { join } from "path";
|
|
35
35
|
import { homedir, tmpdir } from "os";
|
|
36
|
-
import { execSync } from "child_process";
|
|
36
|
+
import { execSync as execSync2 } from "child_process";
|
|
37
37
|
import { confirm } from "@inquirer/prompts";
|
|
38
38
|
import { parse as parseTOML, stringify as stringifyTOML } from "smol-toml";
|
|
39
|
+
|
|
40
|
+
// src/cli/dry-run.ts
|
|
41
|
+
import { execSync } from "child_process";
|
|
42
|
+
import { rmSync, writeFileSync } from "fs";
|
|
43
|
+
var createGuards = (dryRun2, note) => ({
|
|
44
|
+
write: (path, contents) => {
|
|
45
|
+
if (dryRun2) return note("rewrite", path);
|
|
46
|
+
writeFileSync(path, contents, "utf-8");
|
|
47
|
+
},
|
|
48
|
+
remove: (path, options = {}) => {
|
|
49
|
+
if (dryRun2) return note("remove ", path);
|
|
50
|
+
rmSync(path, { recursive: true, force: options.force ?? false });
|
|
51
|
+
},
|
|
52
|
+
exec: (command, options, describe) => {
|
|
53
|
+
if (dryRun2) return note("run ", describe);
|
|
54
|
+
execSync(command, options);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// bin/pushary-clean.ts
|
|
39
59
|
exitOnHelpFlag("clean");
|
|
40
60
|
var dim = (s) => `\x1B[2m${s}\x1B[0m`;
|
|
41
61
|
var bold = (s) => `\x1B[1m${s}\x1B[0m`;
|
|
@@ -54,7 +74,7 @@ var PUSHARY_DIR = join(homedir(), ".pushary");
|
|
|
54
74
|
var SHELL_FILES = [".zshrc", ".zprofile", ".bashrc", ".bash_profile"].map((f) => join(homedir(), f));
|
|
55
75
|
var resolveHermesPython = () => {
|
|
56
76
|
try {
|
|
57
|
-
const launcher =
|
|
77
|
+
const launcher = execSync2("command -v hermes", { encoding: "utf-8", stdio: "pipe", timeout: 5e3 }).trim();
|
|
58
78
|
if (launcher) {
|
|
59
79
|
const shebang = readFileSync(launcher, "utf-8").split("\n", 1)[0];
|
|
60
80
|
if (shebang.startsWith("#!")) {
|
|
@@ -80,18 +100,10 @@ var did = (past) => dryRun ? `(would ${past === "cleaned" ? "clean" : past === "
|
|
|
80
100
|
var wouldNote = (action, path) => {
|
|
81
101
|
console.log(` ${dim("would")} ${action} ${path}`);
|
|
82
102
|
};
|
|
83
|
-
var
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
};
|
|
87
|
-
var guardedRemove = (path, options = {}) => {
|
|
88
|
-
if (dryRun) return wouldNote("remove ", path);
|
|
89
|
-
rmSync(path, { recursive: true, force: options.force });
|
|
90
|
-
};
|
|
91
|
-
var guardedExec = (command, options, describe) => {
|
|
92
|
-
if (dryRun) return wouldNote("run ", describe);
|
|
93
|
-
execSync(command, options);
|
|
94
|
-
};
|
|
103
|
+
var guards = createGuards(dryRun, wouldNote);
|
|
104
|
+
var guardedWrite = (path, contents) => guards.write(path, contents);
|
|
105
|
+
var guardedRemove = (path, options) => guards.remove(path, options);
|
|
106
|
+
var guardedExec = (command, options, describe) => guards.exec(command, options ?? {}, describe);
|
|
95
107
|
var guardedInstructionBlockRemoval = (path) => {
|
|
96
108
|
if (!dryRun) return removeInstructionBlock(path);
|
|
97
109
|
if (!existsSync(path)) return false;
|