Files
agent-radar 2ed3415fb7
Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
源码快照 @ 2026-09-01 (source-only, 剔除非源码素材)
2026-09-01 20:17:27 +08:00

140 lines
4.6 KiB
TypeScript

import type { AgentGuiWorkbenchProvider } from "./types.ts";
import { resolveAgentGUIProviderCatalogIdentity } from "../providerIdentityCatalog.ts";
export const agentGuiWorkbenchProviders = [
"claude-code",
"codex",
"cursor",
"tutti-agent",
"opencode",
"openclaw"
] as const satisfies readonly AgentGuiWorkbenchProvider[];
export const agentGuiWorkbenchDefaultDockProviders = [
"codex",
"claude-code",
"tutti-agent"
] as const satisfies readonly AgentGuiWorkbenchProvider[];
export const agentGuiWorkbenchDockSuppressedProviders = [
"opencode"
] as const satisfies readonly AgentGuiWorkbenchProvider[];
export const agentGuiWorkbenchComingSoonProviders =
[] as const satisfies readonly AgentGuiWorkbenchProvider[];
// Agent integrations still being validated in Tutti. These are gated behind
// the Early Access integrations switch: selection surfaces (dock, launchpad,
// app center, and Agents settings) only show them when the switch is on. This
// describes Tutti's integration maturity, not the upstream Agent's maturity.
// Call sites consume the predicate rather than branching on provider names.
export const agentGuiWorkbenchEarlyAccessProviders = [
"openclaw"
] as const satisfies readonly AgentGuiWorkbenchProvider[];
/** @deprecated Use agentGuiWorkbenchEarlyAccessProviders. */
export const agentGuiWorkbenchPreviewProviders =
agentGuiWorkbenchEarlyAccessProviders;
const defaultDockProviderSet = new Set<AgentGuiWorkbenchProvider>(
agentGuiWorkbenchDefaultDockProviders
);
const dockSuppressedProviderSet = new Set<AgentGuiWorkbenchProvider>(
agentGuiWorkbenchDockSuppressedProviders
);
const comingSoonProviderSet = new Set<AgentGuiWorkbenchProvider>(
agentGuiWorkbenchComingSoonProviders
);
const previewProviderSet = new Set<AgentGuiWorkbenchProvider>(
agentGuiWorkbenchEarlyAccessProviders
);
const agentGuiWorkbenchLabelProviders = [
...agentGuiWorkbenchProviders,
"nexight"
] as const satisfies readonly AgentGuiWorkbenchProvider[];
// Import-only source identities are not runnable registry providers, so they
// have no descriptor in the provider identity catalog. They still need a human
// label wherever imported history surfaces (e.g. ChatGPT data-export history).
const agentGuiWorkbenchImportOnlyProviderLabels: Record<string, string> = {
chatgpt: "ChatGPT"
};
export const agentGuiWorkbenchProviderLabels = {
...Object.fromEntries(
agentGuiWorkbenchLabelProviders.map((provider) => {
const identity = resolveAgentGUIProviderCatalogIdentity(provider);
if (!identity) {
throw new Error(`Missing workbench provider identity for ${provider}`);
}
return [provider, identity.displayName];
})
),
...agentGuiWorkbenchImportOnlyProviderLabels
} as Record<string, string>;
export function resolveAgentGuiWorkbenchProviderLabel(
provider: AgentGuiWorkbenchProvider
): string {
return agentGuiWorkbenchProviderLabels[provider] ?? provider;
}
export function isAgentGuiWorkbenchDefaultDockProvider(
provider: AgentGuiWorkbenchProvider
): boolean {
return defaultDockProviderSet.has(provider);
}
export function isAgentGuiWorkbenchDockSuppressedProvider(
provider: AgentGuiWorkbenchProvider
): boolean {
return dockSuppressedProviderSet.has(provider);
}
export function isAgentGuiWorkbenchComingSoonProvider(
provider: AgentGuiWorkbenchProvider
): boolean {
return comingSoonProviderSet.has(provider);
}
export function isAgentGuiWorkbenchEarlyAccessProvider(
provider: AgentGuiWorkbenchProvider
): boolean {
return previewProviderSet.has(provider);
}
/** @deprecated Use isAgentGuiWorkbenchEarlyAccessProvider. */
export const isAgentGuiWorkbenchPreviewProvider =
isAgentGuiWorkbenchEarlyAccessProvider;
// Whether a provider should be shown given the Early Access integrations
// switch. Stable integrations always show; early-access integrations show only
// when enabled.
export function isAgentGuiWorkbenchProviderVisibleWithEarlyAccess(
provider: AgentGuiWorkbenchProvider,
earlyAccessEnabled: boolean
): boolean {
return earlyAccessEnabled || !previewProviderSet.has(provider);
}
/** @deprecated Use isAgentGuiWorkbenchProviderVisibleWithEarlyAccess. */
export const isAgentGuiWorkbenchProviderVisibleWithPreview =
isAgentGuiWorkbenchProviderVisibleWithEarlyAccess;
export function isAgentGuiWorkbenchProvider(
value: unknown
): value is AgentGuiWorkbenchProvider {
return (
typeof value === "string" && /^[a-z][a-z0-9._:-]{0,127}$/.test(value.trim())
);
}
export function normalizeAgentGuiWorkbenchProvider(
value: unknown
): AgentGuiWorkbenchProvider {
if (!isAgentGuiWorkbenchProvider(value)) {
throw new Error("agent_gui_workbench.invalid_provider");
}
return value.trim();
}