fix(tui): restore legacy sync consumers (#31908)
This commit is contained in:
@@ -317,9 +317,10 @@ export function Autocomplete(props: {
|
||||
const { lineRange, baseQuery } = extractLineRange(query ?? "")
|
||||
|
||||
// Get files from SDK
|
||||
const result = await sdk.client.find.files({
|
||||
const result = await sdk.client.v2.fs.find({
|
||||
query: baseQuery,
|
||||
workspace: project.workspace.current(),
|
||||
limit: "20",
|
||||
location: { workspace: project.workspace.current() },
|
||||
})
|
||||
|
||||
const options: AutocompleteOption[] = []
|
||||
@@ -329,15 +330,13 @@ export function Autocomplete(props: {
|
||||
if (!result.error && result.data) {
|
||||
const width = props.anchor().width - 4
|
||||
options.push(
|
||||
...result.data.map((item): AutocompleteOption => {
|
||||
const { filename, url, part } = createFilePart(item, lineRange)
|
||||
|
||||
const isDir = item.endsWith("/")
|
||||
...result.data.data.map((item): AutocompleteOption => {
|
||||
const { filename, url, part } = createFilePart(item.path, lineRange)
|
||||
return {
|
||||
display: Locale.truncateMiddle(filename, width),
|
||||
value: filename,
|
||||
isDirectory: isDir,
|
||||
path: item,
|
||||
isDirectory: item.type === "directory",
|
||||
path: item.path,
|
||||
onSelect: () => {
|
||||
insertPart(filename, part)
|
||||
},
|
||||
@@ -390,15 +389,15 @@ export function Autocomplete(props: {
|
||||
})
|
||||
|
||||
const agents = createMemo(() => {
|
||||
return (data.location.agent.list() ?? [])
|
||||
return sync.data.agent
|
||||
.filter((agent) => !agent.hidden && agent.mode !== "primary")
|
||||
.map(
|
||||
(agent): AutocompleteOption => ({
|
||||
display: "@" + agent.id,
|
||||
display: "@" + agent.name,
|
||||
onSelect: () => {
|
||||
insertPart(agent.id, {
|
||||
insertPart(agent.name, {
|
||||
type: "agent",
|
||||
name: agent.id,
|
||||
name: agent.name,
|
||||
source: {
|
||||
start: 0,
|
||||
end: 0,
|
||||
|
||||
Reference in New Issue
Block a user