knoxis-helper 1.5.2 → 1.6.0

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.
@@ -32,6 +32,39 @@ function extractFilesTouched(diff) {
32
32
  return Array.from(seen);
33
33
  }
34
34
 
35
+ // Snapshot the 6 well-known state files (docs/state/*.md) so the
36
+ // session record carries the latest STATUS / HANDOFF / DECISIONS / etc.
37
+ // up to the portal for display on qig.ai.
38
+ const STATE_FILES_TO_CAPTURE = [
39
+ 'docs/state/STATUS.md',
40
+ 'docs/state/HANDOFF.md',
41
+ 'docs/state/DECISIONS.md',
42
+ 'docs/state/CHANGELOG.md',
43
+ 'docs/state/OPEN_QUESTIONS.md',
44
+ 'docs/state/RISKS.md'
45
+ ];
46
+ const MAX_STATE_FILE_BYTES = 256 * 1024; // 256KB per file
47
+
48
+ function readStateFiles(workspace) {
49
+ const out = {};
50
+ if (!workspace) return out;
51
+ for (const rel of STATE_FILES_TO_CAPTURE) {
52
+ const abs = path.join(workspace, rel);
53
+ try {
54
+ const stat = fs.statSync(abs);
55
+ if (!stat.isFile()) continue;
56
+ if (stat.size > MAX_STATE_FILE_BYTES) {
57
+ out[rel] = `[File omitted: ${stat.size} bytes exceeds ${MAX_STATE_FILE_BYTES}-byte cap]`;
58
+ continue;
59
+ }
60
+ out[rel] = fs.readFileSync(abs, 'utf8');
61
+ } catch (e) {
62
+ // Missing file is normal — skip silently.
63
+ }
64
+ }
65
+ return out;
66
+ }
67
+
35
68
  // Default git-call helpers — return null on any failure (callers want a string or null).
36
69
  function defaultSafeExec(cmd, cwd) {
37
70
  try {
@@ -204,6 +237,10 @@ class SessionRecorder {
204
237
  completedSteps,
205
238
  closedCleanly,
206
239
  filesTouched: extractFilesTouched(totalDiff),
240
+ // Snapshot of docs/state/*.md at session-end so the QIG frontend can
241
+ // display the latest STATUS / HANDOFF / DECISIONS / etc. without
242
+ // needing live filesystem access on the dev's machine.
243
+ stateFiles: readStateFiles(this.workspace),
207
244
  decisionsLogged: [],
208
245
  waiversRequested: [],
209
246
  incidentsFlagged: [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knoxis-helper",
3
- "version": "1.5.2",
3
+ "version": "1.6.0",
4
4
  "description": "Local helper for Knoxis pair programming - connects your machine to Knoxis on qig.ai",
5
5
  "bin": {
6
6
  "knoxis-helper": "./bin/knoxis-helper.js"