This commit is contained in:
ZacharyZhang-NY committed 2026-03-19 16:04:35 -04:00
1 parent da1fec8f2a
commit b28ed38b8d
116 files changed
+273040 -723

No files matched your search

+9 -14
View File
@@ -2,25 +2,20 @@ import type { CapabilityMatrix, ConnectorRecord } from "./types";
type ConnectorExecutionCandidate = Pick<ConnectorRecord, "status" | "capabilityMatrix"> & Partial<Pick<ConnectorRecord, "label">>;
function missingExecutionCapabilities(capabilityMatrix: CapabilityMatrix | null | undefined) {
const missing: string[] = [];
if (!capabilityMatrix?.sessionResume) missing.push("session resume");
if (!capabilityMatrix?.structuredTranscript) missing.push("structured transcript");
return missing;
}
export function isConnectorExecutionReady(connector: ConnectorExecutionCandidate) {
return connector.status === "ready" && missingExecutionCapabilities(connector.capabilityMatrix).length === 0;
return connector.status === "ready";
}
export function getConnectorExecutionReadinessIssue(connector: ConnectorExecutionCandidate) {
const label = connector.label ?? "Connector";
if (connector.status !== "ready") {
return `${label} is ${connector.status.replaceAll("_", " ")} and cannot be used for autonomous execution.`;
}
const missing = missingExecutionCapabilities(connector.capabilityMatrix);
if (missing.length === 0) {
if (connector.status === "ready") {
return null;
}
return `${label} does not provide ${missing.join(" and ")}, which AgentCompany requires for autonomous execution.`;
if (connector.status === "not_installed") {
return `${label} is not installed.`;
}
if (connector.status === "auth_required") {
return `${label} requires authentication. Run the CLI login command first.`;
}
return `${label} is ${connector.status.replaceAll("_", " ")} and cannot be used for autonomous execution.`;
}
+1
View File
@@ -244,6 +244,7 @@ export type SidebarBadges = z.infer<typeof sidebarBadgesSchema>;
export const settingsSchema = z.object({
theme: z.enum(["system", "light", "dark"]).optional(),
locale: z.enum(["en", "zh"]).optional(),
updatesEnabled: z.boolean().optional(),
logRetentionDays: z.number().int().min(1).max(365).optional(),
});
+4
View File
@@ -0,0 +1,4 @@
export type AppLocale = "en" | "zh";
export const APP_LOCALES: readonly AppLocale[] = ["en", "zh"] as const;
export const LOCALE_LABELS: Record<AppLocale, string> = { en: "English", zh: "中文" };
export const DEFAULT_LOCALE: AppLocale = "en";
+13
View File
@@ -0,0 +1,13 @@
import type { AppLocale } from "./locale";
/**
* Returns a locale-appropriate system prompt instruction for AI agents.
* When locale is "zh", the instruction tells the agent to respond entirely in Chinese.
* For "en" (or any other locale), returns an empty string (no additional instruction needed).
*/
export function getLocalePromptInstruction(locale: AppLocale): string {
if (locale === "zh") {
return "重要:你必须全程使用中文进行所有沟通、回复、任务描述、评论和消息。所有输出内容必须是中文。";
}
return "";
}
+1
View File
@@ -289,6 +289,7 @@ export interface ProfileSnapshot {
profilePath: string;
updatesEnabled: boolean;
theme: "system" | "light" | "dark";
locale: "en" | "zh";
backend: {
secretBackend: string;
};