akm-cli 0.8.6 → 0.8.7
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/CHANGELOG.md +14 -0
- package/dist/commands/consolidate.js +15 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
6
6
|
|
|
7
|
+
## [0.8.7] - 2026-06-09
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- **`incrementalSince` duration strings were silently ignored.** Values like
|
|
12
|
+
`"30m"`, `"24h"`, `"7d"` were passed raw to `narrowToIncrementalCandidates`,
|
|
13
|
+
which compared them against ISO timestamps via string sort. All `2026-...`
|
|
14
|
+
timestamps are lexicographically less than `"30m"` (`'2' < '3'`) and `"24h"`
|
|
15
|
+
(`"20" < "24"`), so `isChanged()` always returned `false` and the candidate
|
|
16
|
+
pool was silently emptied rather than filtered to the window. The fix adds
|
|
17
|
+
`parseSinceToIso()`, which resolves human duration strings to absolute ISO
|
|
18
|
+
timestamps before comparison. Values that already look like ISO timestamps
|
|
19
|
+
are passed through unchanged.
|
|
20
|
+
|
|
7
21
|
## [0.8.6] - 2026-06-09
|
|
8
22
|
|
|
9
23
|
### Added
|
|
@@ -1980,10 +1980,23 @@ async function checkPreEmitDedup(opts) {
|
|
|
1980
1980
|
* everything changed or the index can't answer (fail-open to preserve merge
|
|
1981
1981
|
* correctness). `since` is an ISO timestamp.
|
|
1982
1982
|
*/
|
|
1983
|
+
/**
|
|
1984
|
+
* Parse a human-readable duration string (e.g. "30m", "24h", "7d") to an ISO
|
|
1985
|
+
* timestamp representing `now - duration`. Returns the input unchanged when it
|
|
1986
|
+
* doesn't match the pattern (assumed to already be an ISO timestamp).
|
|
1987
|
+
*/
|
|
1988
|
+
function parseSinceToIso(since) {
|
|
1989
|
+
const m = since.match(/^(\d+)(m|h|d)$/);
|
|
1990
|
+
if (!m)
|
|
1991
|
+
return since;
|
|
1992
|
+
const multiplier = { m: 60_000, h: 3_600_000, d: 86_400_000 }[m[2]];
|
|
1993
|
+
return new Date(Date.now() - parseInt(m[1], 10) * multiplier).toISOString();
|
|
1994
|
+
}
|
|
1983
1995
|
export function narrowToIncrementalCandidates(memories, since, warnings) {
|
|
1996
|
+
const sinceIso = parseSinceToIso(since);
|
|
1984
1997
|
const isChanged = (m) => {
|
|
1985
1998
|
try {
|
|
1986
|
-
return fs.statSync(m.filePath).mtime.toISOString() >
|
|
1999
|
+
return fs.statSync(m.filePath).mtime.toISOString() > sinceIso;
|
|
1987
2000
|
}
|
|
1988
2001
|
catch {
|
|
1989
2002
|
return true; // never silently drop a memory we cannot stat
|
|
@@ -2025,7 +2038,7 @@ export function narrowToIncrementalCandidates(memories, since, warnings) {
|
|
|
2025
2038
|
closeDatabase(db);
|
|
2026
2039
|
}
|
|
2027
2040
|
const candidates = memories.filter((m) => keep.has(m.name));
|
|
2028
|
-
warnings.push(`Incremental consolidation: ${changed.length} changed + neighbours → ${candidates.length}/${memories.length} memories considered (since ${since}).`);
|
|
2041
|
+
warnings.push(`Incremental consolidation: ${changed.length} changed + neighbours → ${candidates.length}/${memories.length} memories considered (since ${since}${sinceIso !== since ? ` = ${sinceIso}` : ""}).`);
|
|
2029
2042
|
return candidates;
|
|
2030
2043
|
}
|
|
2031
2044
|
function loadMemoriesForSource(source, stashDir, warnings) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "akm-cli",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "akm (Agent Knowledge Management) — A package manager for AI agent skills, commands, tools, and knowledge. Works with Claude Code, OpenCode, Cursor, and any AI coding assistant.",
|
|
6
6
|
"keywords": [
|