knoxis-helper 1.6.0 → 1.6.2
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/lib/session-recorder.js +8 -3
- package/lib/state-scaffold.js +10 -3
- package/package.json +1 -1
package/lib/session-recorder.js
CHANGED
|
@@ -65,10 +65,12 @@ function readStateFiles(workspace) {
|
|
|
65
65
|
return out;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
// Default git-call helpers — return null on any failure (callers want a string
|
|
68
|
+
// Default git-call helpers — return null on any failure (callers want a string
|
|
69
|
+
// or null). stdio: 'pipe' prevents stderr from leaking to the parent process
|
|
70
|
+
// (e.g. "fatal: Needed a single revision" when the repo has no commits).
|
|
69
71
|
function defaultSafeExec(cmd, cwd) {
|
|
70
72
|
try {
|
|
71
|
-
return execSync(cmd, { cwd, encoding: 'utf8', timeout: 30000 }).trim();
|
|
73
|
+
return execSync(cmd, { cwd, encoding: 'utf8', timeout: 30000, stdio: ['ignore', 'pipe', 'pipe'] }).trim();
|
|
72
74
|
} catch (e) {
|
|
73
75
|
return null;
|
|
74
76
|
}
|
|
@@ -77,7 +79,10 @@ function defaultSafeExec(cmd, cwd) {
|
|
|
77
79
|
const execAsync = util.promisify(exec);
|
|
78
80
|
async function defaultSafeExecAsync(cmd, cwd) {
|
|
79
81
|
try {
|
|
80
|
-
|
|
82
|
+
// exec() inherits stderr by default; redirect to /dev/null at the shell
|
|
83
|
+
// level so failures (no commits, missing repo) don't pollute output.
|
|
84
|
+
const safeCmd = process.platform === 'win32' ? `${cmd} 2>nul` : `${cmd} 2>/dev/null`;
|
|
85
|
+
const { stdout } = await execAsync(safeCmd, { cwd, encoding: 'utf8', timeout: 30000, maxBuffer: 10 * 1024 * 1024 });
|
|
81
86
|
return stdout.trim();
|
|
82
87
|
} catch (e) {
|
|
83
88
|
return null;
|
package/lib/state-scaffold.js
CHANGED
|
@@ -19,13 +19,17 @@ const STATE_LAYOUT = {
|
|
|
19
19
|
overwrite: false
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
|
+
// Empty sections so the digest parser returns []s instead of inheriting
|
|
23
|
+
// scaffold copy. Claude populates Done / In flight / Next / Notes during
|
|
24
|
+
// session-end per the standards in the systemIntro.
|
|
22
25
|
path: 'docs/state/STATUS.md',
|
|
23
|
-
content: () => `# Status\n\n_Last updated: ${today()}_\n\n## Done\n
|
|
26
|
+
content: () => `# Status\n\n_Last updated: ${today()}_\n\n## Done\n\n## In flight\n\n## Next\n\n## Notes\n`,
|
|
24
27
|
overwrite: false
|
|
25
28
|
},
|
|
26
29
|
{
|
|
30
|
+
// Empty placeholder. HANDOFF gets overwritten in full at every session-end.
|
|
27
31
|
path: 'docs/state/HANDOFF.md',
|
|
28
|
-
content: () => `# Handoff\n\
|
|
32
|
+
content: () => `# Handoff\n\n_No prior session — this file is overwritten at session-end._\n\n## Where I stopped\n\n## Why I stopped here\n\n## First thing to do next session\n\n## Landmines / gotchas\n\n## Environment state\n`,
|
|
29
33
|
overwrite: false
|
|
30
34
|
},
|
|
31
35
|
{
|
|
@@ -34,8 +38,11 @@ const STATE_LAYOUT = {
|
|
|
34
38
|
overwrite: false
|
|
35
39
|
},
|
|
36
40
|
{
|
|
41
|
+
// Empty Unreleased block — Claude appends real entries at session-end
|
|
42
|
+
// when code actually shipped. No fake "scaffolded" entry that would
|
|
43
|
+
// surface as a real changelog item on the dashboard.
|
|
37
44
|
path: 'docs/state/CHANGELOG.md',
|
|
38
|
-
content: () => `# Changelog\n\nAll notable changes to this project will be documented in this file.\nFormat: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).\n\n## [Unreleased]\n\n### Added\n
|
|
45
|
+
content: () => `# Changelog\n\nAll notable changes to this project will be documented in this file.\nFormat: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).\n\n## [Unreleased]\n\n### Added\n\n### Changed\n\n### Fixed\n\n### Removed\n`,
|
|
39
46
|
overwrite: false
|
|
40
47
|
},
|
|
41
48
|
{
|