@restregular/dsh-memory 0.15.1 → 0.15.2
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 +5 -0
- package/lib/provider/index.js +15 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
本项目的版本记录。安装 id 与 npm 版本一一对应。
|
|
4
4
|
|
|
5
|
+
## 0.15.2 — 导出 / 导入保留流程触发词与状态过期时间
|
|
6
|
+
|
|
7
|
+
- 0.15.0 / 0.15.1 新增的 `triggers` 与 `expiredAt` 之前没有进入 `exportAll`,导出再导入会把流程触发词丢掉、把状态记忆重新当成新状态(TTL 重算)。现在两者都随纯文本导出往返;`expiredAt` 导入时作为绝对时间写回,不再重算 TTL。
|
|
8
|
+
- 回归测试:状态记录的 `expiredAt` 与流程的 `triggers` 导出 → 导入到另一个 store 后逐字段一致。
|
|
9
|
+
|
|
5
10
|
## 0.15.1 — 流程索引:procedure 目录进入系统提示
|
|
6
11
|
|
|
7
12
|
0.15.0 的流程记忆只能等模型主动 `memory_search`。这一版把「这个工作区有哪些流程」提前放进系统提示,
|
package/lib/provider/index.js
CHANGED
|
@@ -1845,6 +1845,10 @@ export class LocalMemoryService {
|
|
|
1845
1845
|
|
|
1846
1846
|
|
|
1847
1847
|
|
|
1848
|
+
|
|
1849
|
+
|
|
1850
|
+
|
|
1851
|
+
|
|
1848
1852
|
|
|
1849
1853
|
{
|
|
1850
1854
|
this.discoverScopes()
|
|
@@ -1859,6 +1863,10 @@ export class LocalMemoryService {
|
|
|
1859
1863
|
importance: rec.importance,
|
|
1860
1864
|
createdAt: rec.createdAt,
|
|
1861
1865
|
updatedAt: rec.updatedAt,
|
|
1866
|
+
...(Array.isArray((rec ).triggers)
|
|
1867
|
+
? { triggers: ((rec ).triggers ).map(String) }
|
|
1868
|
+
: {}),
|
|
1869
|
+
...(rec.expiredAt !== undefined ? { expiredAt: rec.expiredAt } : {}),
|
|
1862
1870
|
})
|
|
1863
1871
|
}
|
|
1864
1872
|
}
|
|
@@ -1885,7 +1893,10 @@ export class LocalMemoryService {
|
|
|
1885
1893
|
const errors = []
|
|
1886
1894
|
for (const [index, raw] of list.entries()) {
|
|
1887
1895
|
try {
|
|
1888
|
-
const rec = raw
|
|
1896
|
+
const rec = raw
|
|
1897
|
+
|
|
1898
|
+
|
|
1899
|
+
|
|
1889
1900
|
const content = typeof rec.content === 'string' ? rec.content : ''
|
|
1890
1901
|
if (content.trim().length === 0) throw new Error('content 为空')
|
|
1891
1902
|
const normalized = normalizeScopeInput(typeof rec.scope === 'string' ? rec.scope : undefined)
|
|
@@ -1902,7 +1913,9 @@ export class LocalMemoryService {
|
|
|
1902
1913
|
content,
|
|
1903
1914
|
...(Array.isArray(rec.tags) ? { tags: rec.tags.map(String) } : {}),
|
|
1904
1915
|
...(typeof rec.importance === 'number' ? { importance: rec.importance } : {}),
|
|
1905
|
-
|
|
1916
|
+
...(Array.isArray(rec.triggers) ? { triggers: rec.triggers.map(String) } : {}),
|
|
1917
|
+
...(typeof rec.expiredAt === 'number' && Number.isFinite(rec.expiredAt) ? { expiresAt: rec.expiredAt } : {}),
|
|
1918
|
+
} )
|
|
1906
1919
|
imported += 1
|
|
1907
1920
|
} catch (error) {
|
|
1908
1921
|
rejected += 1
|