claude-dev-env 8.29.0 → 8.29.1
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.
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import test from 'node:test';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
DEFAULT_INACTIVE_DAYS,
|
|
6
|
+
MILLISECONDS_PER_DAY,
|
|
7
|
+
MILLISECONDS_PER_SECOND,
|
|
8
|
+
PAGE_SIZE,
|
|
9
|
+
REQUEST_TIMEOUT_MILLISECONDS,
|
|
10
|
+
ROLLOUT_FILENAME_PATTERN,
|
|
11
|
+
SOURCE_KINDS,
|
|
12
|
+
THREAD_ID_PATTERN,
|
|
13
|
+
} from './constants.mjs';
|
|
14
|
+
|
|
15
|
+
test('cleanse defaults to a seven-day cutoff and bounded requests', () => {
|
|
16
|
+
assert.equal(DEFAULT_INACTIVE_DAYS, 7);
|
|
17
|
+
assert.equal(MILLISECONDS_PER_DAY, 86_400_000);
|
|
18
|
+
assert.equal(MILLISECONDS_PER_SECOND, 1_000);
|
|
19
|
+
assert.equal(PAGE_SIZE, 1_000);
|
|
20
|
+
assert.equal(REQUEST_TIMEOUT_MILLISECONDS, 30_000);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
test('session listing includes every supported source kind', () => {
|
|
24
|
+
assert.deepEqual(SOURCE_KINDS, [
|
|
25
|
+
'cli', 'vscode', 'exec', 'appServer', 'subAgent', 'subAgentReview',
|
|
26
|
+
'subAgentCompact', 'subAgentThreadSpawn', 'subAgentOther', 'unknown',
|
|
27
|
+
]);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test('thread IDs accept UUID spelling and reject malformed IDs', () => {
|
|
31
|
+
assert.equal(THREAD_ID_PATTERN.test('12345678-1234-ABCD-1234-123456789ABC'), true);
|
|
32
|
+
assert.equal(THREAD_ID_PATTERN.test('12345678-1234-ABCD-1234-123456789AB'), false);
|
|
33
|
+
assert.equal(THREAD_ID_PATTERN.test('prefix-12345678-1234-ABCD-1234-123456789ABC'), false);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
test('rollout filenames yield the thread ID and reject other files', () => {
|
|
37
|
+
const threadId = '12345678-1234-ABCD-1234-123456789ABC';
|
|
38
|
+
const filename = `rollout-2026-09-30T12-34-56-${threadId}.jsonl`;
|
|
39
|
+
assert.equal(ROLLOUT_FILENAME_PATTERN.exec(filename)?.[1], threadId);
|
|
40
|
+
assert.equal(ROLLOUT_FILENAME_PATTERN.test(`${filename}.bak`), false);
|
|
41
|
+
assert.equal(ROLLOUT_FILENAME_PATTERN.test(`other-${filename}`), false);
|
|
42
|
+
});
|