feat: v1.1.0 release - session ID tracking, async hooks, new skills

- Add session ID to session filenames (Issue #62)
- Add getSessionIdShort() helper for unique per-session tracking
- Add async hooks documentation with example
- Create iterative-retrieval skill for progressive context refinement
- Add continuous-learning-v2 skill with instinct-based learning
- Add ecc.tools ecosystem section to README
- Update skills list in README

All 67 tests passing.
This commit is contained in:
Affaan Mustafa
2026-01-25 18:21:27 -08:00
parent 5670fcd34f
commit 5c63fa9006
19 changed files with 2058 additions and 5 deletions

View File

@@ -113,14 +113,35 @@ async function runTests() {
// Run the script
await runScript(path.join(scriptsDir, 'session-end.js'));
// Check if session file was created
// Check if session file was created (default session ID)
// Use local time to match the script's getDateString() function
const sessionsDir = path.join(os.homedir(), '.claude', 'sessions');
const today = new Date().toISOString().split('T')[0];
const sessionFile = path.join(sessionsDir, `${today}-session.tmp`);
const now = new Date();
const today = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}`;
const sessionFile = path.join(sessionsDir, `${today}-default-session.tmp`);
assert.ok(fs.existsSync(sessionFile), 'Session file should exist');
})) passed++; else failed++;
if (await asyncTest('includes session ID in filename', async () => {
const testSessionId = 'test-session-abc12345';
const expectedShortId = 'abc12345'; // Last 8 chars
// Run with custom session ID
await runScript(path.join(scriptsDir, 'session-end.js'), '', {
CLAUDE_SESSION_ID: testSessionId
});
// Check if session file was created with session ID
// Use local time to match the script's getDateString() function
const sessionsDir = path.join(os.homedir(), '.claude', 'sessions');
const now = new Date();
const today = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}`;
const sessionFile = path.join(sessionsDir, `${today}-${expectedShortId}-session.tmp`);
assert.ok(fs.existsSync(sessionFile), `Session file should exist: ${sessionFile}`);
})) passed++; else failed++;
// pre-compact.js tests
console.log('\npre-compact.js:');

View File

@@ -106,6 +106,61 @@ function runTests() {
assert.ok(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(dt), `Expected YYYY-MM-DD HH:MM:SS, got ${dt}`);
})) passed++; else failed++;
// Session ID tests
console.log('\nSession ID Functions:');
if (test('getSessionIdShort returns default when no env var', () => {
const originalEnv = process.env.CLAUDE_SESSION_ID;
delete process.env.CLAUDE_SESSION_ID;
try {
const shortId = utils.getSessionIdShort();
assert.strictEqual(shortId, 'default');
} finally {
if (originalEnv) process.env.CLAUDE_SESSION_ID = originalEnv;
}
})) passed++; else failed++;
if (test('getSessionIdShort returns last 8 characters', () => {
const originalEnv = process.env.CLAUDE_SESSION_ID;
process.env.CLAUDE_SESSION_ID = 'test-session-abc12345';
try {
const shortId = utils.getSessionIdShort();
assert.strictEqual(shortId, 'abc12345');
} finally {
if (originalEnv) {
process.env.CLAUDE_SESSION_ID = originalEnv;
} else {
delete process.env.CLAUDE_SESSION_ID;
}
}
})) passed++; else failed++;
if (test('getSessionIdShort uses custom fallback', () => {
const originalEnv = process.env.CLAUDE_SESSION_ID;
delete process.env.CLAUDE_SESSION_ID;
try {
const shortId = utils.getSessionIdShort('custom');
assert.strictEqual(shortId, 'custom');
} finally {
if (originalEnv) process.env.CLAUDE_SESSION_ID = originalEnv;
}
})) passed++; else failed++;
if (test('getSessionIdShort handles short session IDs', () => {
const originalEnv = process.env.CLAUDE_SESSION_ID;
process.env.CLAUDE_SESSION_ID = 'short';
try {
const shortId = utils.getSessionIdShort();
assert.strictEqual(shortId, 'short');
} finally {
if (originalEnv) {
process.env.CLAUDE_SESSION_ID = originalEnv;
} else {
delete process.env.CLAUDE_SESSION_ID;
}
}
})) passed++; else failed++;
// File operations tests
console.log('\nFile Operations:');