xtrm-tools 0.5.38 → 0.5.40

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/cli/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xtrm-cli",
3
- "version": "0.5.38",
3
+ "version": "0.5.40",
4
4
  "description": "Claude Code tools installer (skills, hooks, MCP servers)",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",
@@ -31,14 +31,14 @@ withSafeBdContext(() => {
31
31
  runtime: 'claude',
32
32
  sessionId: ctx.sessionId,
33
33
  layer: 'gate',
34
- kind: 'gate.stop.block',
35
- outcome: 'block',
34
+ kind: 'gate.stop.nudge',
35
+ outcome: 'nudge',
36
36
  issueId: decision.claimed ?? null,
37
37
  message,
38
38
  extra: { reason_code: decision.reason },
39
39
  });
40
- process.stderr.write(message);
41
- process.exit(2);
40
+ process.stdout.write(JSON.stringify({ additionalContext: message }) + '\n');
41
+ process.exit(0);
42
42
  }
43
43
 
44
44
  logEvent({
@@ -4,7 +4,7 @@
4
4
  // so the agent starts every session already oriented on the xtrm workflow.
5
5
  // Exit 0 in all paths (fail open).
6
6
 
7
- import { readFileSync } from 'node:fs';
7
+ import { readFileSync, existsSync } from 'node:fs';
8
8
  import { join } from 'node:path';
9
9
 
10
10
  let input;
@@ -24,6 +24,18 @@ try {
24
24
  // Strip YAML frontmatter (--- ... ---\n)
25
25
  content = content.replace(/^---[\s\S]*?---\n/, '').trim();
26
26
 
27
+ // Append .xtrm/memory.md if it exists in the project
28
+ const cwd = input?.cwd ?? process.env.CLAUDE_PROJECT_DIR ?? process.cwd();
29
+ const memoryPath = join(cwd, '.xtrm', 'memory.md');
30
+ if (existsSync(memoryPath)) {
31
+ try {
32
+ const memory = readFileSync(memoryPath, 'utf8').trim();
33
+ if (memory) {
34
+ content += '\n\n---\n\n' + memory;
35
+ }
36
+ } catch { /* fail open */ }
37
+ }
38
+
27
39
  process.stdout.write(
28
40
  JSON.stringify({
29
41
  hookSpecificOutput: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xtrm-tools",
3
- "version": "0.5.38",
3
+ "version": "0.5.40",
4
4
  "description": "Claude Code tools installer (skills, hooks, MCP servers)",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xtrm-tools",
3
- "version": "0.5.38",
3
+ "version": "0.5.40",
4
4
  "description": "xtrm-tools: dual-runtime workflow enforcement (Claude Code + Pi) — hooks, extensions, skills, and MCP servers",
5
5
  "author": {
6
6
  "name": "jaggers"
@@ -31,14 +31,14 @@ withSafeBdContext(() => {
31
31
  runtime: 'claude',
32
32
  sessionId: ctx.sessionId,
33
33
  layer: 'gate',
34
- kind: 'gate.stop.block',
35
- outcome: 'block',
34
+ kind: 'gate.stop.nudge',
35
+ outcome: 'nudge',
36
36
  issueId: decision.claimed ?? null,
37
37
  message,
38
38
  extra: { reason_code: decision.reason },
39
39
  });
40
- process.stderr.write(message);
41
- process.exit(2);
40
+ process.stdout.write(JSON.stringify({ additionalContext: message }) + '\n');
41
+ process.exit(0);
42
42
  }
43
43
 
44
44
  logEvent({
@@ -4,7 +4,7 @@
4
4
  // so the agent starts every session already oriented on the xtrm workflow.
5
5
  // Exit 0 in all paths (fail open).
6
6
 
7
- import { readFileSync } from 'node:fs';
7
+ import { readFileSync, existsSync } from 'node:fs';
8
8
  import { join } from 'node:path';
9
9
 
10
10
  let input;
@@ -24,6 +24,18 @@ try {
24
24
  // Strip YAML frontmatter (--- ... ---\n)
25
25
  content = content.replace(/^---[\s\S]*?---\n/, '').trim();
26
26
 
27
+ // Append .xtrm/memory.md if it exists in the project
28
+ const cwd = input?.cwd ?? process.env.CLAUDE_PROJECT_DIR ?? process.cwd();
29
+ const memoryPath = join(cwd, '.xtrm', 'memory.md');
30
+ if (existsSync(memoryPath)) {
31
+ try {
32
+ const memory = readFileSync(memoryPath, 'utf8').trim();
33
+ if (memory) {
34
+ content += '\n\n---\n\n' + memory;
35
+ }
36
+ } catch { /* fail open */ }
37
+ }
38
+
27
39
  process.stdout.write(
28
40
  JSON.stringify({
29
41
  hookSpecificOutput: {