mirror of
https://github.com/sweetwisdom/everything-claude-code-zh.git
synced 2026-03-21 22:10:09 +00:00
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:
@@ -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:');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user