feat(web): trim @ mention rows and cut their discovery cost

Session candidates labelled from projection checkpoints instead of a full
log fold per keystroke, with the uncheckpointed remainder folded once and
memoized while its log stays cold. The file index keeps answering while an
invalidated traversal rebuilds behind the caret, and its default exclusions
now cover build outputs so deep sources stay reachable.

Rows carry only what distinguishes them: a file names its parent directory,
a session names its workspace only when that workspace is not the current
one, and a drilled listing names none because its new breadcrumb does.

Resolves #3180
Related to #3154
This commit is contained in:
Yichen Jiang
2026-08-27 11:42:06 +08:00
parent a24c71127f
commit 97e0299f74
62 changed files with 1615 additions and 248 deletions
+13 -1
View File
@@ -34,7 +34,7 @@ interface SessionReferenceInput {
}
```
`SessionReferenceCandidate` is host-facing discovery output. Its label uses the latest session title when present, while filtering still searches only session id and cwd and never transcript text.
`SessionReferenceCandidate` is host-facing discovery output. Its label uses the latest session title when present, and filtering searches that label alongside session id and cwd, never transcript text.
```ts type-equiv
/** One host-facing candidate from exact session metadata. */
@@ -45,6 +45,12 @@ interface SessionReferenceCandidate {
label: string
/** Source session working directory, when recorded. */
cwd?: string
/**
* True when {@link SessionReferenceCandidate.cwd} is recorded and equals the
* requesting agent's. Hosts that only surface a distinguishing location
* read this instead of comparing paths they never received.
*/
sameWorkspace: boolean
/** Source session creation time in Unix epoch milliseconds. */
createdAt: number
}
@@ -138,6 +144,12 @@ Exact-read consumer that prepares immutable cross-session message context.
```ts cordis-catalog
/**
* List reference candidates, ranked by working-directory affinity.
*
* A title comes from the projection cache when that cache holds a
* checkpoint for the session; otherwise it is folded from the session's log
* once and remembered for as long as the log stays cold. Without the cache
* composed, only the cwd-ranked head of an unfiltered listing is folded, so
* its tail cannot match a title substring.
* @param agent - target agent; self is excluded and its cwd drives ranking.
* @param query - optional case-insensitive session-id/cwd/title substring.
* @param limit - optional positive result cap.