import { z } from 'zod'; import type { Config } from '../config/schema.js'; import type { FileSpaceService } from '../files/file-service.js'; import type { ExternalToolProvider } from '../agent/external-tools/types.js'; import { type CapabilityContext, type CapabilityDispatcher } from '../capabilities/runtime/dispatcher.js'; import type { LocalAppService } from './service.js'; import type { LocalAppResourceScopes } from '@xopcai/gateway-contract'; type ConnectorBinding = Extract['bindings'][number]; declare const connectorInput: z.ZodObject<{ toolRef: z.ZodString; accountId: z.ZodString; arguments: z.ZodDefault>; }, z.core.$strict>; declare const exportInput: z.ZodObject<{ name: z.ZodString; encoding: z.ZodDefault>; content: z.ZodString; }, z.core.$strict>; declare const resultSchema: z.ZodObject<{ id: z.ZodUUID; kind: z.ZodEnum<{ export: "export"; connector: "connector"; }>; status: z.ZodEnum<{ unknown: "unknown"; pending: "pending"; approved: "approved"; rejected: "rejected"; }>; expiresAt: z.ZodNumber; result: z.ZodOptional; }, z.core.$strip>; export type AppResourceRequest = z.infer & { extensionId: string; manifestDigest: string; grantRevision: string; releaseId: string; digest: string; input: z.infer | z.infer; decision?: boolean; capabilityId?: string; binding?: ConnectorBinding; accountLabel?: string; reviewerPrincipalId?: string; }; export type LocalAppP1Deps = { getConfig: () => Config; getFiles: () => FileSpaceService; getProviders?: () => ExternalToolProvider[]; }; export declare function localAppConnectorOptions(deps: LocalAppP1Deps): Promise<{ id: string; title: string; binding: { revision: string; scope: "read" | "write"; toolRef: string; connectorId: string; accountId: string; connectionId: string; }; }[]>; export declare function readAppResourceRequest(extensionId: string, id: string): AppResourceRequest; export declare function assertResourceRequest(apps: Pick, record: AppResourceRequest): { releaseId: string; grantRevision: string | undefined; resourceScopes: { notesRead: { mode: "none"; } | { mode: "workspace"; } | { mode: "selected"; ids: string[]; projectIds: string[]; includeCreated: boolean; }; notesWrite: { mode: "none"; } | { mode: "workspace"; } | { mode: "selected"; ids: string[]; projectIds: string[]; includeCreated: boolean; }; tasksRead: { mode: "none"; } | { mode: "workspace"; } | { mode: "selected"; ids: string[]; projectIds: string[]; includeCreated: boolean; }; tasksWrite: { mode: "none"; } | { mode: "workspace"; } | { mode: "selected"; ids: string[]; projectIds: string[]; includeCreated: boolean; }; projectsRead: { mode: "none"; } | { mode: "workspace"; } | { mode: "selected"; ids: string[]; projectIds: string[]; includeCreated: boolean; }; projectsWrite: { mode: "none"; } | { mode: "workspace"; } | { mode: "selected"; ids: string[]; projectIds: string[]; includeCreated: boolean; }; filesRead: { mode: "none"; } | { mode: "selected"; ids: string[]; }; filesExport: boolean; filesImport: boolean; connectors: { mode: "none"; } | { mode: "selected"; bindings: { toolRef: string; connectorId: string; accountId: string; connectionId: string; revision: string; scope: "read" | "write"; }[]; }; automationsRead: { mode: "none"; } | { mode: "workspace"; } | { mode: "selected"; ids: string[]; projectIds: string[]; includeCreated: boolean; }; automationProposals: boolean; automationsRun: { mode: "none"; } | { mode: "selected"; approvals: { id: string; configurationDigest: string; authority: { model: boolean; tools: boolean; dataWrite: boolean; externalSend: boolean; expiresAt: number; maxRuns: number; maxCostMicrousd: number; }; }[]; }; agentDelegate: boolean; }; bindings: { id: "xopc.notes.get" | "xopc.notes.list" | "xopc.tasks.get" | "xopc.tasks.list" | "xopc.notes.create" | "xopc.notes.update" | "xopc.notes.append" | "xopc.agent.delegate" | "xopc.automations.list" | "xopc.automations.get" | "xopc.automations.run" | "xopc.automations.get_run" | "xopc.automations.cancel" | "xopc.automations.simulate" | "xopc.automations.propose" | "xopc.automations.get_proposal" | "xopc.automations.history" | "xopc.automations.run_events" | "xopc.projects.get" | "xopc.projects.list" | "xopc.projects.list_milestones" | "xopc.projects.list_updates" | "xopc.projects.update" | "xopc.projects.create_milestone" | "xopc.projects.update_milestone" | "xopc.projects.create_update" | "xopc.tasks.create" | "xopc.tasks.update" | "xopc.files.read" | "xopc.files.propose_export" | "xopc.connectors.describe" | "xopc.connectors.read" | "xopc.connectors.propose_write" | "xopc.apps.get_request"; majorVersion: number; descriptorDigest: string; }[]; }; export declare function resolveAppResourceRequest(deps: LocalAppP1Deps, apps: Pick, extensionId: string, id: string, digest: string, approve: boolean, caller: CapabilityContext): Promise<{ id: string; kind: "export" | "connector"; status: "unknown" | "pending" | "approved" | "rejected"; expiresAt: number; result?: z.core.util.JSONType | undefined; }>; export declare function registerLocalAppP1Capabilities(dispatcher: CapabilityDispatcher, deps: LocalAppP1Deps): void; export {};