sawbuck 0.1.45 → 0.1.47
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/CONTRACT.md +8 -8
- package/README.md +33 -29
- package/contract-cmd.mjs +19 -9
- package/debt.mjs +25 -10
- package/exclude.mjs +5 -4
- package/history.mjs +4 -1
- package/init.mjs +7 -6
- package/package.json +3 -2
- package/pipe.mjs +2 -0
- package/reflect.mjs +24 -9
- package/repo-state.mjs +22 -5
- package/rules.mjs +2 -1
- package/sawbuck.mjs +347 -131
- package/shape.mjs +95 -11
- package/status.mjs +13 -1
- package/steers.mjs +2 -2
package/rules.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Find the rules you keep enforcing and never wrote down. `prepare` gathers what you typed to Claude Code, on this
|
|
2
2
|
// machine, with copies and likely secrets removed. The agent proposes rules from it, each with quotes. `check` proves
|
|
3
3
|
// every quote is really yours: a rule with fewer than two real quotes is dropped. Nothing is added to any file here.
|
|
4
|
-
import { readFileSync, writeFileSync, mkdirSync, existsSync, statSync } from 'node:fs';
|
|
4
|
+
import { readFileSync, writeFileSync, mkdirSync, existsSync, statSync, chmodSync } from 'node:fs';
|
|
5
5
|
import { join } from 'node:path';
|
|
6
6
|
import { homedir } from 'node:os';
|
|
7
7
|
import { readHistory, typedText } from './history.mjs';
|
|
@@ -32,6 +32,7 @@ export function prepareRules({ home = homedir() } = {}) {
|
|
|
32
32
|
const { dir, input } = paths(home);
|
|
33
33
|
mkdirSync(dir, { recursive: true });
|
|
34
34
|
writeFileSync(input, lines.join('\n') + '\n', { mode: 0o600 });
|
|
35
|
+
chmodSync(input, 0o600); // the mode above only applies to a new file
|
|
35
36
|
return { input, lines: lines.length, secrets };
|
|
36
37
|
}
|
|
37
38
|
|