Skip to content

Commit 7dcddac

Browse files
committed
fix(desktop): repair TypeScript type errors in agent dialogs, summary, and composer
1 parent 71b84e4 commit 7dcddac

5 files changed

Lines changed: 24 additions & 11 deletions

File tree

desktop/src/features/agents/observerRelayStore.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { decryptObserverEvent } from "@/shared/api/tauriObserver";
1010
import { normalizePubkey } from "@/shared/lib/pubkey";
1111
import { useQueryClient } from "@tanstack/react-query";
1212
import { useIdentityQuery } from "@/shared/api/hooks";
13+
import { agentConfigSurfaceQueryKey } from "./hooks";
1314
import {
1415
parseAgentManagementRequest,
1516
type AgentManagementRequest,

desktop/src/features/agents/ui/AgentManagementDialogs.tsx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { useAgentManagement } from "@/features/agents/useAgentManagement";
22
import { AgentCardDialogs } from "./AgentCardViewerDialog";
33
import { AgentDialog } from "./AgentDialog";
44
import { AgentDraftAdoptDialog } from "./AgentDraftAdoptDialog";
5-
import { SecretRevealDialog } from "./SecretRevealDialog";
65

76
/** Global review surfaces opened by owned agents through the Buzz harness. */
87
export function AgentManagementDialogs() {
@@ -37,18 +36,20 @@ export function AgentManagementDialogs() {
3736
if (!open) management.dismiss();
3837
}}
3938
/>
40-
) : null}
41-
{management.createdAgent ? (
42-
<SecretRevealDialog
43-
attachmentFailure={management.attachmentFailure}
44-
created={management.createdAgent}
45-
isRetryingAttachment={management.isRetryingAttachment}
39+
) : management.request?.action === "create" ? (
40+
<AgentDialog
41+
definitionError={
42+
management.error ? new Error(management.error) : null
43+
}
44+
initialValues={management.createInitialValues}
45+
isDefinitionPending={management.isPending}
46+
mode="definition"
4647
onOpenChange={(open) => {
47-
if (!open) management.dismissCreatedAgent();
48-
}}
49-
onRetryAttachment={() => {
50-
void management.retryAttachment();
48+
if (!open) management.dismiss();
5149
}}
50+
onSubmitDefinition={management.submitCreate}
51+
runtimes={management.runtimes}
52+
runtimeCatalogStatus={management.runtimeCatalogStatus}
5253
/>
5354
) : null}
5455
{management.request?.action === "update" ? (

desktop/src/features/agents/ui/RunOnSummarySection.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ export function RunOnSummarySection({
3333
>
3434
This computer
3535
</p>
36+
) : summary.location === "external" ? (
37+
<p
38+
className="text-sm text-muted-foreground"
39+
data-testid="edit-agent-run-on-location"
40+
>
41+
External agent
42+
</p>
3643
) : (
3744
<div className="space-y-2 rounded-2xl border border-border bg-muted/30 px-4 py-3">
3845
<p

desktop/src/features/agents/ui/runOnSummary.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export type RunOnConfigRow = {
1818

1919
export type RunOnSummary =
2020
| { location: "local" }
21+
| { location: "external" }
2122
| { location: "provider"; providerId: string; rows: RunOnConfigRow[] };
2223

2324
/**
@@ -139,6 +140,7 @@ function compareKeys(a: string, b: string): number {
139140
*/
140141
export function summarizeRunOn(backend: ManagedAgentBackend): RunOnSummary {
141142
if (backend.type === "local") return { location: "local" };
143+
if (backend.type === "external") return { location: "external" };
142144
const rows = Object.entries(backend.config ?? {})
143145
.sort(([a], [b]) => compareKeys(a, b))
144146
.map(([key, value]): RunOnConfigRow => {

desktop/src/features/messages/ui/MessageComposer.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ import { ComposerAudienceChips } from "./ComposerAudienceChips";
5757
import { useComposerAgentAudience } from "./useComposerAgentAudience";
5858
import { useMentionSendFlow } from "./useMentionSendFlow";
5959
import { usePersistentAgentMentionHydration } from "./usePersistentAgentMentionHydration";
60+
import { useComposerContentState } from "./useComposerContentState";
61+
import { useDraftPersistLifecycle } from "./useDraftPersistSnapshot";
6062
import { submitMessageEdit } from "./submitMessageEdit";
6163
import { prepareBackgroundLinkPreviews } from "@/features/messages/lib/linkPreviewPreparationStore";
6264
import { useComposerLinkPreviews } from "./useComposerLinkPreviews";

0 commit comments

Comments
 (0)