import type { AgentEntry, AgentProfile, SkillOverride } from '../agent-config/index.js'; import { type MarketplaceCategoryOption, type SkillsStorePackageListItem, type StoreAgentDependencies, type StoreAgentPackageDetail } from '../agent/skills/marketplace/adapters/store/store-api-client.js'; import type { Config } from '../config/schema.js'; import type { AutomationService } from '../automations/service/automation-service.js'; import { AgentCatalogRepository } from './repository.js'; import { AgentCatalogService } from './service.js'; import type { StoredAgent } from './types.js'; export declare class AgentStoreError extends Error { readonly status: 400 | 403 | 404 | 409 | 502; readonly code?: string | undefined; constructor(message: string, status?: 400 | 403 | 404 | 409 | 502, code?: string | undefined); } export interface AgentDependencyStatusItem { kind: 'plugin' | 'skill' | 'app'; name: string; displayName?: string; required: boolean; reason?: string; status: 'installed' | 'missing' | 'needs_auth'; } export interface StoreAgentCatalogItem extends SkillsStorePackageListItem { installed: boolean; installedAgentId?: string; installedVersion?: string; customized?: boolean; updateAvailable?: boolean; verified: boolean; } export interface StoreAgentCatalogResponse { items: StoreAgentCatalogItem[]; categories: MarketplaceCategoryOption[]; meta: { page: number; pageSize: number; total: number; totalPages: number; }; storeBaseUrl: string; } export interface StoreAgentDetailResponse { agent: StoreAgentPackageDetail & { installed: boolean; installedAgentId?: string; installedVersion?: string; customized?: boolean; updateAvailable?: boolean; verified: boolean; dependencyStatus: AgentDependencyStatusItem[]; }; } export interface StoreAgentInstallResult { agent: StoredAgent; alreadyInstalled: boolean; dependencyStatus: AgentDependencyStatusItem[]; createdRoutineIds: string[]; onboardingPrompt?: string; starterPrompts?: string[]; } export interface StoreAgentRoutineBlueprint { id: string; name: string; description?: string; scheduleSummary?: string; trigger: { kind: 'manual'; } | { kind: 'schedule'; schedule: { kind: 'cron'; expr: string; tz?: string; } | { kind: 'interval'; everyMs: number; }; }; instruction: string; conversationMode?: 'new_session' | 'continuous'; safety?: { mode?: 'suggest_only' | 'ask_before_apply' | 'auto_apply'; }; notificationPolicy?: 'attention' | 'all' | 'none'; enabled: false; } export type StoreAgentLocalizationEntry = { displayName?: string; description?: string; }; export type StoreAgentLocalizations = Record; export interface ParsedAgentBlueprint { slug: string; version: string; category?: string; categories: string[]; profile: AgentProfile; localizations?: StoreAgentLocalizations; specialistProfile?: AgentEntry['specialistProfile']; toolAllowlist?: string[]; suggestedToolPolicies?: NonNullable; skillsPolicy?: SkillOverride; dependencies?: StoreAgentDependencies; routines: StoreAgentRoutineBlueprint[]; onboardingPrompt?: string; starterPrompts?: string[]; profileFiles: Record; bundledSkills: Array<{ relativePath: string; content: string; }>; avatarAsset?: { ext: 'svg' | 'png' | 'webp'; bytes: Buffer; }; rawManifest: Record; } export declare function normalizeStoreLocale(locale: string | undefined): 'zh-CN' | 'en' | undefined; /** * Clamp store-suggested tool policies so a Store Agent blueprint can only narrow * or match global `agents.defaults.tools` and never escalate sensitive tools. */ export declare function clampStoreToolPolicies(suggested: NonNullable | undefined, globalDefaults: NonNullable): NonNullable | undefined; export declare function extractAndValidateAgentBlueprint(zipBuffer: Buffer, expectedSlug: string): ParsedAgentBlueprint; export interface AgentStoreServiceDeps { getConfig: () => Config; repository?: AgentCatalogRepository; catalogService?: AgentCatalogService; automationService?: AutomationService; hasLocalAppPackage?: (packageName: string) => boolean; onCatalogChanged?: () => void; } export declare class AgentStoreService { private readonly deps; private readonly repository; private readonly catalogService; constructor(deps: AgentStoreServiceDeps); private storeBaseUrl; private resolveDependencyStatus; private installedByPackageMap; listStoreAgents(params: { q?: string; category?: string; sort?: 'downloads' | 'newest'; page?: number; pageSize?: number; locale?: string; }): Promise; getStoreAgentDetail(packageName: string): Promise; private allocateAgentId; private writeBlueprintFiles; installFromStore(params: { packageName: string; version?: string; agentId?: string; locale?: string; verifiedOnly?: boolean; remix?: boolean; includeRoutines?: boolean; }): Promise; upgradeFromStore(agentIdRaw: string, params?: { version?: string; locale?: string; verifiedOnly?: boolean; }): Promise; removeStoreAgent(agentIdRaw: string, options?: { deleteRoutines?: boolean; purge?: boolean; }): Promise<{ agentId: string; removedBindings: number; deletedRoutineIds: string[]; }>; }