feat(commands): multi-select ordered command pipeline with step reordering and single-pass composition (AI-05, AI-07)
This commit is contained in:
parent
f49acf0105
commit
10af20a0ad
157 changed files with 29455 additions and 913 deletions
|
|
@ -23,7 +23,8 @@ import {
|
|||
type GraphContext,
|
||||
type PersonalGraphQuery,
|
||||
type PersonalGraphStats,
|
||||
type PhraseSource
|
||||
type PhraseSource,
|
||||
type TwoHopGraphEdge
|
||||
} from '@d3ro/core/personal-graph'
|
||||
import { SUGGESTION_MEMORY_TAIL_CHARS, isLearnablePhrase, prefixTail } from '@d3ro/core/input-intelligence'
|
||||
import { analyzeWritingContext } from '@d3ro/core/writing-context'
|
||||
|
|
@ -254,16 +255,16 @@ class PersonalGraphService {
|
|||
const directFollowHops = firstHopEdges.filter(
|
||||
(edge) => edge.kind === 'follows' && anchors.includes(edge.fromPhrase)
|
||||
)
|
||||
const normalizedFirstHop = firstHopEdges.flatMap((edge) => {
|
||||
const normalizedFirstHop = firstHopEdges.flatMap<TwoHopGraphEdge>((edge) => {
|
||||
if (edge.kind === 'follows' && anchors.includes(edge.fromPhrase)) {
|
||||
return [{ from: edge.fromPhrase, to: edge.toPhrase, kind: 'follows' as const, weight: edge.weight }]
|
||||
return [{ from: edge.fromPhrase, to: edge.toPhrase, kind: 'follows', weight: edge.weight }]
|
||||
}
|
||||
if (edge.kind === 'shares_terms') {
|
||||
if (anchors.includes(edge.fromPhrase)) {
|
||||
return [{ from: edge.fromPhrase, to: edge.toPhrase, kind: 'shares_terms' as const, weight: edge.weight }]
|
||||
return [{ from: edge.fromPhrase, to: edge.toPhrase, kind: 'shares_terms', weight: edge.weight }]
|
||||
}
|
||||
if (anchors.includes(edge.toPhrase)) {
|
||||
return [{ from: edge.toPhrase, to: edge.fromPhrase, kind: 'shares_terms' as const, weight: edge.weight }]
|
||||
return [{ from: edge.toPhrase, to: edge.fromPhrase, kind: 'shares_terms', weight: edge.weight }]
|
||||
}
|
||||
}
|
||||
return []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue