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/.claude-plugin/plugin.json +1 -1
- package/cli/dist/index.cjs +64 -16
- package/cli/dist/index.cjs.map +1 -1
- package/cli/package.json +1 -1
- package/config/pi/extensions/beads/index.ts +10 -4
- package/config/pi/extensions/xtrm-loader/index.ts +13 -1
- package/hooks/using-xtrm-reminder.mjs +13 -1
- package/package.json +1 -1
- package/plugins/xtrm-tools/.claude-plugin/plugin.json +1 -1
- package/plugins/xtrm-tools/hooks/using-xtrm-reminder.mjs +13 -1
package/cli/package.json
CHANGED
|
@@ -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
|
|
240
|
-
`
|
|
241
|
-
`
|
|
242
|
-
`
|
|
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
|
@@ -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: {
|