refactor: prune dead IPC surface and orphaned modules
Drop code that nothing consumed. Verified by full renderer+shared grep:
every removed channel had zero callers via window.agentCompany.* and
zero references from desktop-api types. No backend internal use either —
the database/API-server layers keep their methods, only the IPC exposure
goes.
Removed IPC handlers (26 total):
Thread CRUD surface (12) — writes happen inside the backend
createThread, listThreads, addThreadEvent,
setThreadWaitState, resolveThreadWaitState,
addParticipant, removeParticipant, listParticipants,
subscribeThread, unsubscribeThread,
listSubscriptions, listSubscribedThreads
(kept reads: getThread, listThreadEvents, listThreadWaitStates)
Half-implemented features (13)
saveSecret, listComments, getAgentMetrics, getApiPort,
listWakeupRequests, listAgentMessages, autoAssignTask,
listRunEvents, recoveryDismiss,
getHeartbeatPolicy, setHeartbeatPolicy,
getRuntimeState, setRuntimeState
Whole vertical slice: openConnectorAuthTerminal
IPC handler + channel + preload + DesktopApi type +
connector-auth-service function + useConnectorCallbacks
handleLoginConnector + OnboardingContext.onLoginConnector +
OnboardingWizard wiring. Pi-mono has no CLI auth flow;
the no-op that "returned false for legacy UI compatibility"
had no legacy UI left.
Orphaned modules (zero importers in repo):
src/main/runtime-env.ts
src/main/database-stale-recovery.ts
Dead schema files (only referenced by their own barrel re-export):
schemas-participants, schemas-subscriptions, schemas-heartbeat,
schemas-run-events, schemas-runtime-state, schemas-wakeup
Renderer leftovers:
.activity-row-enter CSS + its two unreferenced keyframes
5 orphan i18n keys (app.console, app.refresh, app.expand,
activity.timeline, auto.trigger) left over from earlier feature
deletions
Also update two unit tests that mocked openConnectorAuthTerminal in
the RegisterCoreHandlersDependencies pick.
This commit is contained in:
1 parent
1f7230fe87
commit
c71d033b0c
37 files changed
+17
-929
No files matched your search
@@ -59,7 +59,6 @@ export interface OnboardingConnectorsContextValue {
|
||||
model: string | null,
|
||||
notes?: string,
|
||||
) => void;
|
||||
onLoginConnector: (connectorId: string) => void;
|
||||
|
||||
selectedConnectorId: ConnectorId | "";
|
||||
setSelectedConnectorId: (value: ConnectorId | "") => void;
|
||||
|
||||
@@ -83,7 +83,7 @@ export function CompanyOnboarding({
|
||||
}
|
||||
}, [step, nodeStatus, checkNode]);
|
||||
|
||||
const { handleTestConnector, handleSaveConnector, handleLoginConnector, handleInstallCommand } =
|
||||
const { handleTestConnector, handleSaveConnector, handleInstallCommand } =
|
||||
useConnectorCallbacks(connectors);
|
||||
|
||||
const {
|
||||
@@ -208,7 +208,6 @@ export function CompanyOnboarding({
|
||||
hasAtLeastOneReady,
|
||||
onTestConnector: (id) => void handleTestConnector(id),
|
||||
onSaveConnector: (id, env, model, notes) => void handleSaveConnector(id, env, model, notes),
|
||||
onLoginConnector: (id) => void handleLoginConnector(id),
|
||||
selectedConnectorId,
|
||||
setSelectedConnectorId,
|
||||
selectedModel,
|
||||
@@ -228,7 +227,6 @@ export function CompanyOnboarding({
|
||||
hasAtLeastOneReady,
|
||||
handleTestConnector,
|
||||
handleSaveConnector,
|
||||
handleLoginConnector,
|
||||
selectedConnectorId,
|
||||
setSelectedConnectorId,
|
||||
selectedModel,
|
||||
|
||||
@@ -36,30 +36,6 @@ export function useConnectorCallbacks(connectors: ProfileSnapshot["connectors"])
|
||||
}
|
||||
}, [connectors]);
|
||||
|
||||
const handleLoginConnector = useCallback(async (connectorId: string) => {
|
||||
try {
|
||||
unwrap(await window.agentCompany.openConnectorAuthTerminal(connectorId as ConnectorId));
|
||||
} catch (error) {
|
||||
console.warn(
|
||||
`[onboarding/useConnectorCallbacks] openConnectorAuthTerminal(${connectorId}) failed: ${error instanceof Error ? error.message : String(error)}`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
// Poll connector health after login terminal opens (same pattern as ConnectorEditor)
|
||||
let attempts = 0;
|
||||
const poll = setInterval(async () => {
|
||||
attempts++;
|
||||
if (attempts > 12) { clearInterval(poll); return; }
|
||||
try {
|
||||
unwrap(await window.agentCompany.testConnector(connectorId as ConnectorId));
|
||||
} catch (error) {
|
||||
console.warn(
|
||||
`[onboarding/useConnectorCallbacks] post-login testConnector(${connectorId}) failed (attempt ${attempts}): ${error instanceof Error ? error.message : String(error)}`,
|
||||
);
|
||||
}
|
||||
}, 5000);
|
||||
}, []);
|
||||
|
||||
const handleInstallCommand = useCallback(async (commandKey: z.infer<typeof openTerminalCommandSchema>["commandKey"]) => {
|
||||
try {
|
||||
unwrap(await window.agentCompany.openTerminalCommand({ commandKey }));
|
||||
@@ -88,5 +64,5 @@ export function useConnectorCallbacks(connectors: ProfileSnapshot["connectors"])
|
||||
}, 5000);
|
||||
}, [connectors]);
|
||||
|
||||
return { handleTestConnector, handleSaveConnector, handleLoginConnector, handleInstallCommand };
|
||||
return { handleTestConnector, handleSaveConnector, handleInstallCommand };
|
||||
}
|
||||
@@ -39,10 +39,7 @@ export const en: Record<string, string> = {
|
||||
"app.selectCompany": "Select company",
|
||||
"app.newCompany": "New company",
|
||||
"app.commandPalette": "Command palette",
|
||||
"app.refresh": "Refresh",
|
||||
"app.console": "Console",
|
||||
"app.collapse": "Collapse",
|
||||
"app.expand": "Expand",
|
||||
"app.noResults": "No results for",
|
||||
"app.clear": "Clear",
|
||||
"app.search": "Search sections, agents, tasks, goals, projects...",
|
||||
@@ -358,9 +355,6 @@ export const en: Record<string, string> = {
|
||||
"costs.recentEntries": "Recent cost entries",
|
||||
"costs.budgetPosture": "Budget posture",
|
||||
|
||||
// ── Activity page ──
|
||||
"activity.timeline": "Activity timeline",
|
||||
|
||||
// ── Workspaces page ──
|
||||
"workspaces.registry": "Workspace registry",
|
||||
"workspaces.controlCenter": "Workspace control center",
|
||||
@@ -815,7 +809,6 @@ export const en: Record<string, string> = {
|
||||
"auto.newRuleTitle": "New Automation Rule",
|
||||
"auto.ruleName": "Rule Name",
|
||||
"auto.ruleDescription": "Description",
|
||||
"auto.trigger": "Trigger",
|
||||
"auto.conditionsJson": "Conditions (JSON)",
|
||||
"auto.action": "Action",
|
||||
"auto.actionConfigJson": "Action Configuration (JSON)",
|
||||
|
||||
@@ -39,10 +39,7 @@ export const zh: Record<string, string> = {
|
||||
"app.selectCompany": "选择公司",
|
||||
"app.newCompany": "新建公司",
|
||||
"app.commandPalette": "命令面板",
|
||||
"app.refresh": "刷新",
|
||||
"app.console": "控制台",
|
||||
"app.collapse": "收起",
|
||||
"app.expand": "展开",
|
||||
"app.noResults": "未找到匹配结果",
|
||||
"app.clear": "清除",
|
||||
"app.search": "搜索版块、智能体、任务、目标、项目...",
|
||||
@@ -358,9 +355,6 @@ export const zh: Record<string, string> = {
|
||||
"costs.recentEntries": "近期费用",
|
||||
"costs.budgetPosture": "预算概况",
|
||||
|
||||
// ── 活动页面 ──
|
||||
"activity.timeline": "活动时间线",
|
||||
|
||||
// ── 工作区页面 ──
|
||||
"workspaces.registry": "工作区注册表",
|
||||
"workspaces.controlCenter": "工作区控制中心",
|
||||
@@ -815,7 +809,6 @@ export const zh: Record<string, string> = {
|
||||
"auto.newRuleTitle": "新建自动化规则",
|
||||
"auto.ruleName": "规则名称",
|
||||
"auto.ruleDescription": "描述",
|
||||
"auto.trigger": "触发器",
|
||||
"auto.conditionsJson": "条件(JSON)",
|
||||
"auto.action": "动作",
|
||||
"auto.actionConfigJson": "动作配置(JSON)",
|
||||
|
||||
@@ -207,48 +207,6 @@
|
||||
transition: max-width 200ms cubic-bezier(0.16, 1, 0.3, 1);
|
||||
}
|
||||
|
||||
/* Dashboard activity row entry motion */
|
||||
@keyframes dashboard-activity-enter {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateY(-14px) scale(0.985);
|
||||
filter: blur(4px);
|
||||
}
|
||||
62% {
|
||||
opacity: 1;
|
||||
transform: translateY(2px) scale(1.002);
|
||||
filter: blur(0);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateY(0) scale(1);
|
||||
filter: blur(0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes dashboard-activity-highlight {
|
||||
0% {
|
||||
box-shadow: inset 2px 0 0 var(--primary);
|
||||
background-color: color-mix(in oklab, var(--accent) 55%, transparent);
|
||||
}
|
||||
100% {
|
||||
box-shadow: inset 0 0 0 transparent;
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
.activity-row-enter {
|
||||
animation:
|
||||
dashboard-activity-enter 520ms cubic-bezier(0.16, 1, 0.3, 1),
|
||||
dashboard-activity-highlight 920ms cubic-bezier(0.16, 1, 0.3, 1);
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.activity-row-enter {
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* MDXEditor theme integration */
|
||||
.paperclip-mdxeditor-scope,
|
||||
.paperclip-mdxeditor {
|
||||
|
||||
Reference in new issue
Block a user