asmgr 0.4.0 → 0.4.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.
- package/README.md +3 -1
- package/dist/asmgr.mjs +16 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -179,7 +179,9 @@ asmgr search "database migration" --session <session-id> # 只在一个会话
|
|
|
179
179
|
|
|
180
180
|
每条命中是一行 tab 分隔、以 `project` 列(cwd 最近的含 `.git` 祖先目录;找不到 `.git` 祖先时为 cwd 原值,无 cwd 时为 `(unscoped)`)开头:`project`、`agent`、`session-id`、`#条目`、`role/kind`、`摘录`。
|
|
181
181
|
|
|
182
|
-
`--session <id>` 把搜索限定到一个会话(先精确匹配 id
|
|
182
|
+
`--session <id>` 把搜索限定到一个会话(先精确匹配 id,否则按前缀匹配;DSH 的 id 是 `session-<uuid>`,直接给裸 uuid 也可以)——用来在**当前这个会话**里按关键词找模型回复,不必先用 `--file` 指路径。
|
|
183
|
+
|
|
184
|
+
跨会话搜索对每个会话独立解析:遇到官方迁移器拒绝或损坏的存档时,在 stderr 逐条报出路径与原因后跳过,不中断其余会话的检索;stdout 的命中行不受影响。
|
|
183
185
|
|
|
184
186
|
### `asmgr import`
|
|
185
187
|
|
package/dist/asmgr.mjs
CHANGED
|
@@ -43220,7 +43220,7 @@ var {
|
|
|
43220
43220
|
var BIN_NAME = "asmgr";
|
|
43221
43221
|
|
|
43222
43222
|
// src/cli/version.ts
|
|
43223
|
-
var VERSION = true ? "0.4.
|
|
43223
|
+
var VERSION = true ? "0.4.1" : devVersion();
|
|
43224
43224
|
|
|
43225
43225
|
// src/core/index.ts
|
|
43226
43226
|
import { stat as stat2 } from "node:fs/promises";
|
|
@@ -54801,13 +54801,25 @@ async function findSession(id, agents = AGENTS, roots = {}) {
|
|
|
54801
54801
|
return findSessionAmong(await discoverSessions(agents, roots), id);
|
|
54802
54802
|
}
|
|
54803
54803
|
function findSessionAmong(refs, id) {
|
|
54804
|
-
|
|
54804
|
+
for (const needle of id.startsWith("session-") ? [id] : [id, `session-${id}`]) {
|
|
54805
|
+
const found = refs.find((session) => session.id === needle) ?? refs.find((session) => session.id.startsWith(needle));
|
|
54806
|
+
if (found) return found;
|
|
54807
|
+
}
|
|
54808
|
+
return void 0;
|
|
54805
54809
|
}
|
|
54806
54810
|
async function searchRefs(refs, query, limit = 20) {
|
|
54807
54811
|
const hits = [];
|
|
54808
54812
|
const needle = query.toLowerCase();
|
|
54813
|
+
let skipped = 0;
|
|
54809
54814
|
for (const ref of refs) {
|
|
54810
|
-
|
|
54815
|
+
let parsed;
|
|
54816
|
+
try {
|
|
54817
|
+
parsed = await parseSession(ref);
|
|
54818
|
+
} catch (error) {
|
|
54819
|
+
skipped++;
|
|
54820
|
+
console.error(`\u8DF3\u8FC7\u65E0\u6CD5\u89E3\u6790\u7684\u4F1A\u8BDD ${ref.path}\uFF1A${error instanceof Error ? error.message : String(error)}`);
|
|
54821
|
+
continue;
|
|
54822
|
+
}
|
|
54811
54823
|
for (const entry of parsed.entries) {
|
|
54812
54824
|
const searchText = timelineEntrySearchText(entry);
|
|
54813
54825
|
if (!searchText.toLowerCase().includes(needle)) continue;
|
|
@@ -54830,6 +54842,7 @@ async function searchRefs(refs, query, limit = 20) {
|
|
|
54830
54842
|
if (hits.length >= limit) return hits;
|
|
54831
54843
|
}
|
|
54832
54844
|
}
|
|
54845
|
+
if (skipped > 0) console.error(`\u5DF2\u8DF3\u8FC7 ${skipped} \u4E2A\u65E0\u6CD5\u89E3\u6790\u7684\u4F1A\u8BDD\uFF08\u8BE6\u89C1\u4E0A\u65B9\u5404\u6761\u8DEF\u5F84\u4E0E\u539F\u56E0\uFF09`);
|
|
54833
54846
|
return hits;
|
|
54834
54847
|
}
|
|
54835
54848
|
async function summarizeSession(ref) {
|