Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 0 additions & 5 deletions apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@
"test": "bun test"
},
"dependencies": {
"@ai-sdk/anthropic": "3.0.64",
"@ai-sdk/openai": "3.0.36",
"@ai-sdk/react": "3.0.143",
"@ast-grep/napi": "0.41.1",
"@better-auth/api-key": "1.6.22",
"@better-auth/stripe": "1.6.22",
Expand Down Expand Up @@ -73,7 +70,6 @@
"@hono/node-server": "2.0.10",
"@hookform/resolvers": "5.2.2",
"@lezer/highlight": "1.2.3",
"@mastra/core": "1.33.1",
"@paper-design/shaders-react": "0.0.77",
"@parcel/watcher": "2.5.6",
"@pierre/diffs": "1.2.12",
Expand All @@ -85,7 +81,6 @@
"@streamdown/mermaid": "1.0.2",
"@superset/auth": "workspace:*",
"@superset/chat": "workspace:*",
"@superset/chat-legacy": "workspace:*",
"@superset/db": "workspace:*",
"@superset/host-service": "workspace:*",
"@superset/local-db": "workspace:*",
Expand Down
63 changes: 0 additions & 63 deletions apps/desktop/src/lib/trpc/routers/chat-runtime-service/index.ts

This file was deleted.

2 changes: 0 additions & 2 deletions apps/desktop/src/lib/trpc/routers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { createBrowserRouter } from "./browser/browser";
import { createBrowserHistoryRouter } from "./browser-history";
import { createCacheRouter } from "./cache";
import { createChangesRouter } from "./changes";
import { createChatRuntimeServiceRouter } from "./chat-runtime-service";
import { createChatServiceRouter } from "./chat-service";
import { createConfigRouter } from "./config";
import { createDeviceRouter } from "./device";
Expand All @@ -33,7 +32,6 @@ import { createWorkspacesRouter } from "./workspaces";

export const createAppRouter = (getWindow: () => BrowserWindow | null) => {
return router({
chatRuntimeService: createChatRuntimeServiceRouter(),
chatService: createChatServiceRouter(),
analytics: createAnalyticsRouter(),
browser: createBrowserRouter(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { PROMPT_TRANSPORTS } from "@superset/local-db";
import type { AgentDefinition } from "@superset/shared/agent-catalog";
import type {
AgentPresetPatch,
CustomAgentDefinitionPatch,
Expand Down Expand Up @@ -67,10 +66,8 @@ function toTrimmedRequiredValue(field: string, value: string): string {
}

export function normalizeAgentPresetPatch({
definition,
patch,
}: {
definition: AgentDefinition;
patch: z.infer<typeof updateAgentPresetInputSchema>["patch"];
}): AgentPresetPatch {
const normalized: AgentPresetPatch = {};
Expand Down Expand Up @@ -100,23 +97,18 @@ export function normalizeAgentPresetPatch({
normalized.taskPromptTemplate = taskPromptTemplate;
}

if (definition.kind === "terminal") {
if (patch.command !== undefined) {
normalized.command = toTrimmedRequiredValue("Command", patch.command);
}
if (patch.promptCommand !== undefined) {
normalized.promptCommand = toTrimmedRequiredValue(
"Prompt command",
patch.promptCommand,
);
}
if (patch.promptCommandSuffix !== undefined) {
const promptCommandSuffix = patch.promptCommandSuffix?.trim() ?? "";
normalized.promptCommandSuffix = promptCommandSuffix || null;
}
} else if (patch.model !== undefined) {
const model = patch.model?.trim() ?? "";
normalized.model = model || null;
if (patch.command !== undefined) {
normalized.command = toTrimmedRequiredValue("Command", patch.command);
}
if (patch.promptCommand !== undefined) {
normalized.promptCommand = toTrimmedRequiredValue(
"Prompt command",
patch.promptCommand,
);
}
if (patch.promptCommandSuffix !== undefined) {
const promptCommandSuffix = patch.promptCommandSuffix?.trim() ?? "";
normalized.promptCommandSuffix = promptCommandSuffix || null;
}

if (Object.keys(normalized).length === 0) {
Expand Down
1 change: 0 additions & 1 deletion apps/desktop/src/lib/trpc/routers/settings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,6 @@ export const createSettingsRouter = () => {
}

const normalizedPatch = normalizeAgentPresetPatch({
definition,
patch: input.patch,
});
const nextOverrides = createOverrideEnvelopeWithPatch({
Expand Down
18 changes: 1 addition & 17 deletions apps/desktop/src/lib/trpc/routers/ui-state/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,13 @@ const fileViewerStateSchema = z.object({
oldPath: z.string().optional(),
});

const chatLaunchConfigSchema = z.object({
initialPrompt: z.string().optional(),
metadata: z
.object({
model: z.string().optional(),
})
.optional(),
retryCount: z.number().int().min(0).optional(),
});

/**
* Zod schema for Pane
*/
const paneSchema = z.object({
id: z.string(),
tabId: z.string(),
type: z.enum(["terminal", "webview", "file-viewer", "chat", "devtools"]),
type: z.enum(["terminal", "webview", "file-viewer", "devtools"]),
name: z.string(),
isNew: z.boolean().optional(),
status: z.enum(["idle", "working", "permission", "review"]).optional(),
Expand All @@ -63,12 +53,6 @@ const paneSchema = z.object({
cwd: z.string().nullable().optional(),
cwdConfirmed: z.boolean().optional(),
fileViewer: fileViewerStateSchema.optional(),
chat: z
.object({
sessionId: z.string().nullable(),
launchConfig: chatLaunchConfigSchema.nullable().optional(),
})
.optional(),
browser: z
.object({
currentUrl: z.string(),
Expand Down
2 changes: 0 additions & 2 deletions apps/desktop/src/main/host-service/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
installUpgradeSocketGuard,
JwtApiAuthProvider,
LocalGitCredentialProvider,
LocalModelProvider,
PskHostAuthProvider,
startTerminalReaper,
} from "@superset/host-service";
Expand Down Expand Up @@ -108,7 +107,6 @@ async function main(): Promise<void> {
auth: authProvider,
hostAuth: new PskHostAuthProvider(env.HOST_SERVICE_SECRET),
credentials: new LocalGitCredentialProvider(),
modelResolver: new LocalModelProvider(),
},
});

Expand Down
39 changes: 2 additions & 37 deletions apps/desktop/src/main/lib/notifications/resolve-pane-id.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,6 @@ describe("resolvePaneIdFromTabsState", () => {
type: "terminal" as const,
name: "Terminal",
},
"pane-chat": {
id: "pane-chat",
tabId: "tab-1",
type: "chat" as const,
name: "Chat",
chat: {
sessionId: "session-1",
launchConfig: null,
},
},
},
activeTabIds: { "ws-1": "tab-1" },
focusedPaneIds: { "tab-1": "pane-1" },
Expand All @@ -48,44 +38,19 @@ describe("resolvePaneIdFromTabsState", () => {
"pane-new",
"tab-new",
"ws-new",
undefined,
),
).toBe("pane-new");
});

it("resolves the focused pane from tabId when paneId is missing", () => {
expect(
resolvePaneIdFromTabsState(
tabsState,
undefined,
"tab-1",
undefined,
undefined,
),
resolvePaneIdFromTabsState(tabsState, undefined, "tab-1", undefined),
).toBe("pane-1");
});

it("resolves the focused pane from workspaceId when paneId is missing", () => {
expect(
resolvePaneIdFromTabsState(
tabsState,
undefined,
undefined,
"ws-1",
undefined,
),
resolvePaneIdFromTabsState(tabsState, undefined, undefined, "ws-1"),
).toBe("pane-1");
});

it("resolves the pane from sessionId when paneId is missing", () => {
expect(
resolvePaneIdFromTabsState(
tabsState,
undefined,
undefined,
undefined,
"session-1",
),
).toBe("pane-chat");
});
});
13 changes: 0 additions & 13 deletions apps/desktop/src/main/lib/notifications/resolve-pane-id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export function resolvePaneIdFromTabsState(
paneId: string | undefined,
tabId: string | undefined,
workspaceId: string | undefined,
sessionId: string | undefined,
): string | undefined {
if (paneId) {
return paneId;
Expand All @@ -40,16 +39,6 @@ export function resolvePaneIdFromTabsState(
}
}

if (sessionId) {
for (const [existingPaneId, pane] of Object.entries(
tabsState.panes ?? {},
)) {
if (pane.chat?.sessionId === sessionId) {
return existingPaneId;
}
}
}

return undefined;
}

Expand All @@ -62,7 +51,6 @@ export function resolvePaneId(
paneId: string | undefined,
tabId: string | undefined,
workspaceId: string | undefined,
sessionId: string | undefined,
): string | undefined {
if (paneId) {
return paneId;
Expand All @@ -74,7 +62,6 @@ export function resolvePaneId(
undefined,
tabId,
workspaceId,
sessionId,
);
} catch {
// App state not initialized yet, ignore
Expand Down
4 changes: 1 addition & 3 deletions apps/desktop/src/main/lib/notifications/server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import { resolvePaneId } from "./resolve-pane-id";
describe("notifications/server", () => {
describe("resolvePaneId", () => {
it("returns an explicit paneId even when app state is not initialized", () => {
expect(resolvePaneId("pane-1", "tab-1", "ws-1", "session-1")).toBe(
"pane-1",
);
expect(resolvePaneId("pane-1", "tab-1", "ws-1")).toBe("pane-1");
});
});

Expand Down
1 change: 0 additions & 1 deletion apps/desktop/src/main/lib/notifications/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ app.get("/hook/complete", (req, res) => {
paneId as string | undefined,
tabId as string | undefined,
workspaceId as string | undefined,
sessionId as string | undefined,
);

// v1 pane agent-session capture for the v1→v2 migration's resume seeding.
Expand Down
Loading
Loading