xtrm-tools 0.5.39 → 0.5.41

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.39",
3
+ "version": "0.5.41",
4
4
  "description": "Claude Code tools installer (skills, hooks, MCP servers)",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",
@@ -236,10 +236,16 @@ export default function (pi: ExtensionAPI) {
236
236
  memoryGateFired = true;
237
237
  pi.sendUserMessage(
238
238
  `🧠 Memory gate: claim \`${closedIssueId}\` was closed this session.\n` +
239
- `For each closed issue, worth persisting?\n` +
240
- ` YES \`bd remember "<insight>"\`\n` +
241
- ` NO → note "nothing to persist"\n` +
242
- ` Then acknowledge: \`bd kv set "memory-gate-done:${sessionId}" 1\``,
239
+ `For each candidate insight, check ALL 4:\n` +
240
+ ` 1. Hard to rediscover from code/docs?\n` +
241
+ ` 2. Not obvious from the current implementation?\n` +
242
+ ` 3. Will affect a future decision?\n` +
243
+ ` 4. Still relevant in ~14 days?\n` +
244
+ `KEEP (all 4 yes) → \`bd remember "<insight>"\`\n` +
245
+ `SKIP examples: file maps, flag inventories, per-issue summaries,\n` +
246
+ ` wording tweaks, facts obvious from reading the source.\n` +
247
+ `KEEP: \`bd kv set "memory-gate-done:${sessionId}" "saved: <key>"\`\n` +
248
+ `SKIP: \`bd kv set "memory-gate-done:${sessionId}" "nothing novel — <one-line reason>"\``,
243
249
  );
244
250
  };
245
251
 
@@ -118,7 +118,7 @@ export default function (pi: ExtensionAPI) {
118
118
  }
119
119
  });
120
120
 
121
- pi.on("before_agent_start", async (event) => {
121
+ pi.on("before_agent_start", async (event, ctx) => {
122
122
  const parts: string[] = [];
123
123
 
124
124
  // Prepend using-xtrm skill (session operating manual)
@@ -126,6 +126,18 @@ export default function (pi: ExtensionAPI) {
126
126
  parts.push("# XTRM Session Operating Manual\n\n" + usingXtrmContent);
127
127
  }
128
128
 
129
+ // Inject .xtrm/memory.md if present (synthesized project context)
130
+ const memoryPath = path.join(ctx.cwd, ".xtrm", "memory.md");
131
+ if (fs.existsSync(memoryPath)) {
132
+ try {
133
+ const memoryContent = fs.readFileSync(memoryPath, "utf8").trim();
134
+ if (memoryContent) {
135
+ parts.push(memoryContent);
136
+ logger.info(`Injected .xtrm/memory.md (${memoryContent.length} chars)`);
137
+ }
138
+ } catch { /* fail open */ }
139
+ }
140
+
129
141
  // Append project context
130
142
  if (projectContext) {
131
143
  parts.push("# Project Intelligence Context\n\n" + projectContext);
@@ -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.39",
3
+ "version": "0.5.41",
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.39",
3
+ "version": "0.5.41",
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"
@@ -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: {