New threads, model and mode picker, alerts, $EDITOR and terminal attach
- c starts a draft thread (project, model, mode, worktree) launched with orchestration.launchThread - m picks model, provider options and access mode from the server's providers, following the web's provider lock; model changes ride on the next message - Alerts port T3's notification gate: bell, OSC 9/99 desktop notifications when unfocused, in-app flash - ctrl+g edits the message in $EDITOR; ctrl+j attaches to the thread's T3 terminal - Credential gains terminal:read
This commit is contained in:
1 parent
121bbd9137
commit
626d37a4e9
18 files changed
+1074
-49
No files matched your search
@@ -88,3 +88,34 @@ export function paletteGroups(input: {
|
||||
export function paletteEntries(groups: readonly PaletteGroup[]): PaletteEntry[] {
|
||||
return groups.flatMap((group) => group.entries);
|
||||
}
|
||||
|
||||
/** A choice in a picker (model, option, project, terminal…). */
|
||||
export interface PickerItem {
|
||||
readonly id: string;
|
||||
readonly title: string;
|
||||
/** Shown on the right: "current", a provider, a status. */
|
||||
readonly hint?: string;
|
||||
readonly run: () => void;
|
||||
}
|
||||
|
||||
export interface Picker {
|
||||
readonly placeholder: string;
|
||||
readonly groups: readonly { readonly label: string; readonly items: readonly PickerItem[] }[];
|
||||
}
|
||||
|
||||
/** A picker's groups filtered and ranked by the query, in the palette's shape. */
|
||||
export function pickerGroups(picker: Picker, query: string): PaletteGroup[] {
|
||||
const folded = foldSearchQuery(query);
|
||||
return picker.groups
|
||||
.map((group) => {
|
||||
const items = folded
|
||||
? group.items
|
||||
.map((item) => ({ item, match: scoreSearchTerms(folded, [item.title, group.label, item.hint ?? ""], { typos: true }) }))
|
||||
.filter((candidate) => candidate.match !== null)
|
||||
.sort((a, b) => b.match!.score - a.match!.score)
|
||||
.map(({ item }) => item)
|
||||
: group.items;
|
||||
return { label: group.label, entries: items.map((item): PaletteEntry => ({ kind: "command", command: { id: item.id, title: item.title, ...(item.hint ? { shortcut: item.hint } : {}) } })) };
|
||||
})
|
||||
.filter((group) => group.entries.length > 0);
|
||||
}
|
||||
Reference in new issue
Block a user