Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(types): make the branch typecheck clean

Dashf9438ec4e06c
diff --git a/apps/desktop/src/main/browser-extension/bridge.ts b/apps/desktop/src/main/browser-extension/bridge.ts
index 309b26fa3a..67476d2b14 100644
--- a/apps/desktop/src/main/browser-extension/bridge.ts
+++ b/apps/desktop/src/main/browser-extension/bridge.ts
@@ -401,7 +401,8 @@ export class BrowserExtensionBridge {
if (typeof value === 'string') {
const limit = Math.min(remaining, FIELD_VALUE_MAX);
if (value.length > limit) {
- finalValue = isHttp(value) ? null : value.slice(0, limit);
+ // A URL cut mid-way would still be a URL to the model; drop it instead.
+ finalValue = /^https?:\/\//i.test(value) ? null : value.slice(0, limit);
truncated = true;
}
remaining -= (finalValue as string | null)?.length || 0;
@@ -449,12 +450,13 @@ export class BrowserExtensionBridge {
>;
job.resolve({
...safe,
+ ok: safe.ok === true,
browser: job.clientId,
timing: { ...timing, totalMs: this.now() - job.created },
...(isBrowserExtensionReadAction(job.action) && job.action !== 'tabs'
? { untrusted_content: true }
: {}),
- } as BrowserExtensionJobResult);
+ });
}
private jobFailure(job: Job, error: string, message: string): BrowserExtensionFailure {
@@ -1204,7 +1206,7 @@ export class BrowserExtensionBridge {
}
const kind = action as BrowserExtensionAction;
const gate = checkBrowserExtensionPolicy(this.policy, kind, payload.url);
- if (!gate.ok) return gate;
+ if (!gate.ok) return { ...gate };
const until = this.now() + (this.options.connectWait ?? 6000);
while (!this.connected().length && this.now() < until)
await new Promise((r) => setTimeout(r, 100));
diff --git a/apps/desktop/src/main/maker-ipc/pluginTaskDefaultRoute.ts b/apps/desktop/src/main/maker-ipc/pluginTaskDefaultRoute.ts
index b3d33d8dc8..cdad96f253 100644
--- a/apps/desktop/src/main/maker-ipc/pluginTaskDefaultRoute.ts
+++ b/apps/desktop/src/main/maker-ipc/pluginTaskDefaultRoute.ts
@@ -63,6 +63,6 @@ export function pluginTaskRouteAttempts<T>(
}
/** The plugin left the route open when none of the identifying fields is set. */
-export function pluginTaskSelectionIsOpen(selection: { agentKind?: unknown; model?: unknown; providerId?: unknown }): boolean {
+export function pluginTaskSelectionIsOpen(selection: { agentKind?: unknown; model?: unknown; providerId?: unknown; effort?: unknown; fastMode?: unknown }): boolean {
return !selection.agentKind && !selection.model && !selection.providerId;
}
diff --git a/apps/desktop/src/preload/preload.ts b/apps/desktop/src/preload/preload.ts
index 8dbef45fcb..0dff6ea503 100644
--- a/apps/desktop/src/preload/preload.ts
+++ b/apps/desktop/src/preload/preload.ts
@@ -4066,6 +4066,7 @@ contextBridge.exposeInMainWorld('electronAPI', {
| { type: 'provider-import'; importId: string }
| { type: 'plugin'; pluginId: string }
| { type: 'local-plugin-share'; snapshotId: string }
+ | { type: 'installed-plugin'; ghostId?: string }
| { type: 'shared-task-join'; invitation: string; server: string }
| { type: 'provider-share-join'; link: string }
| { type: 'chat-invite'; token: string }
@@ -4184,6 +4185,7 @@ contextBridge.exposeInMainWorld('electronAPI', {
| { type: 'provider-import'; importId: string }
| { type: 'plugin'; pluginId: string }
| { type: 'local-plugin-share'; snapshotId: string }
+ | { type: 'installed-plugin'; ghostId?: string }
| { type: 'shared-task-join'; invitation: string; server: string }
| { type: 'provider-share-join'; link: string }
| { type: 'chat-invite'; token: string }
diff --git a/apps/desktop/src/renderer/components/layout/MainLayout.tsx b/apps/desktop/src/renderer/components/layout/MainLayout.tsx
index 6be980d0e2..c8d264927e 100644
--- a/apps/desktop/src/renderer/components/layout/MainLayout.tsx
+++ b/apps/desktop/src/renderer/components/layout/MainLayout.tsx
@@ -733,6 +733,7 @@ export function MainLayout() {
| { type: 'provider-share-join'; link: string }
| { type: 'plugin'; pluginId: string }
| { type: 'local-plugin-share'; snapshotId: string }
+ | { type: 'installed-plugin'; ghostId?: string }
| { type: 'settings'; tab: 'voice-input' | 'providers' | 'billing' | 'remote-control'; connect?: string; intent?: 'topup' },
) => {
if (payload.type === 'chat-message') {
diff --git a/apps/desktop/src/renderer/vite-env.d.ts b/apps/desktop/src/renderer/vite-env.d.ts
index cf745588c0..fedcc0afdb 100644
--- a/apps/desktop/src/renderer/vite-env.d.ts
+++ b/apps/desktop/src/renderer/vite-env.d.ts
@@ -3093,6 +3093,7 @@ interface ElectronAPI {
| { type: 'provider-share-join'; link: string }
| { type: 'plugin'; pluginId: string }
| { type: 'local-plugin-share'; snapshotId: string }
+ | { type: 'installed-plugin'; ghostId?: string }
| { type: 'settings'; tab: 'voice-input' | 'providers' | 'billing' | 'remote-control'; connect?: string; intent?: 'topup' },
) => void,
) => () => void;
@@ -3116,6 +3117,7 @@ interface ElectronAPI {
| { type: 'provider-share-join'; link: string }
| { type: 'plugin'; pluginId: string }
| { type: 'local-plugin-share'; snapshotId: string }
+ | { type: 'installed-plugin'; ghostId?: string }
| { type: 'settings'; tab: 'voice-input' | 'providers' | 'billing' | 'remote-control'; connect?: string; intent?: 'topup' }
| null
>;
diff --git a/packages/lizi-mcps/src/types.ts b/packages/lizi-mcps/src/types.ts
index da44724fb9..3f4c8b0c05 100644
--- a/packages/lizi-mcps/src/types.ts
+++ b/packages/lizi-mcps/src/types.ts
@@ -669,8 +669,12 @@ export interface BrowserMcpDeps {
/** Local structural observations only; no URLs, scripts, selectors or input values. */
experienceStore?: import('./browser/experience.js').BrowserExperienceStore;
getRuntime(): BrowserControlRuntime;
- /** Resolve the actual host profile before validation, discovery and execution. */
- resolveProfile?(profile?: string): string;
+ /**
+ * Resolve the actual host profile before validation, discovery and execution.
+ * undefined keeps the agent's own choice (the user-browser backend picks the
+ * only connected browser, or asks for one when several are connected).
+ */
+ resolveProfile?(profile?: string): string | undefined;
/** Existing host lifecycle/backend identities; changes invalidate session evidence. */
getBackendScope?(): { lifecycle: object; backend: object };
/**