import type { CustomAgentProfile, RemoteAgentManifest, ResourceKind as StoredResourceKind, SkillMetadata } from "../../resources/metadata.js"; import { type BuiltinCapability } from "./use-builtin-capabilities.js"; import type { McpServer } from "./use-mcp-servers.js"; export type ResourceKind = StoredResourceKind | "mcp-server" | "mcp-builtin"; export interface Resource { id: string; path: string; owner: string; content: string; mimeType: string; size: number; createdAt: number; updatedAt: number; createdBy: "user" | "agent" | "system"; visibility: "workspace" | "agent_scratch"; threadId: string | null; runId: string | null; expiresAt: number | null; metadata: string | null; } export interface ResourceMeta { id: string; path: string; owner: string; mimeType: string; size: number; createdAt: number; updatedAt: number; createdBy: "user" | "agent" | "system"; visibility: "workspace" | "agent_scratch"; threadId: string | null; runId: string | null; expiresAt: number | null; metadata: string | null; } export interface JobMetadata { schedule?: string; scheduleDescription?: string; enabled?: boolean; lastStatus?: "success" | "error" | "running" | "skipped"; lastRun?: string; nextRun?: string; } export interface TreeNode { name: string; path: string; type: "file" | "folder"; kind?: ResourceKind; children?: TreeNode[]; resource?: ResourceMeta; jobMeta?: JobMetadata; skillMeta?: SkillMetadata; agentMeta?: CustomAgentProfile; remoteAgentMeta?: RemoteAgentManifest; mcpServerMeta?: McpServer; mcpBuiltinMeta?: BuiltinCapability & { scope: "user" | "org"; scopeEnabled: boolean; }; } export type ResourceScope = "personal" | "shared" | "workspace" | "all"; export type EffectiveResourceScope = "workspace" | "shared" | "personal"; export interface EffectiveResourceLayer { scope: EffectiveResourceScope; label: string; owner: string; resource: ResourceMeta | null; exists: boolean; effective: boolean; overridden: boolean; canWrite: boolean; } export interface EffectiveResourceContext { path: string; effectiveResource: ResourceMeta | null; effectiveScope: EffectiveResourceScope | null; layers: EffectiveResourceLayer[]; } export declare function withMcpServersFolder(tree: TreeNode[], servers: McpServer[], opts?: { alwaysShow?: boolean; builtins?: Array<{ capability: BuiltinCapability; scope: "user" | "org"; }>; }): TreeNode[]; export declare function withAgentScratchFolder(tree: TreeNode[], opts?: { show?: boolean; }): TreeNode[]; export declare function resourceDownloadUrl(id: string): string; export declare function useResources(scope?: ResourceScope): import("@tanstack/react-query").UseQueryResult, Error>; export declare function useResourceTree(scope?: ResourceScope, opts?: { includeAgentScratch?: boolean; }): import("@tanstack/react-query").UseQueryResult, Error>; export declare function useResource(id: string | null): import("@tanstack/react-query").UseQueryResult, Error>; export declare function useEffectiveResourceContext(path: string | null): import("@tanstack/react-query").UseQueryResult, Error>; export declare function useCreateResource(): import("@tanstack/react-query").UseMutationResult; export declare function useUpdateResource(): import("@tanstack/react-query").UseMutationResult; export declare function useDeleteResource(): import("@tanstack/react-query").UseMutationResult; export type ResourcePackExportScope = "personal" | "organization" | "workspace" | "accessible"; export declare function resourcePackScopeFromPanel(scope: ResourceScope): ResourcePackExportScope; export declare function resourcePackDownloadFilename(exportedAt?: number): string; export declare function downloadResourcePackJson(pack: unknown, filename?: string): void; export declare function useExportResourcePack(): import("@tanstack/react-query").UseMutationResult<{ pack: unknown; }, Error, { scope?: ResourcePackExportScope; prefix?: string; }, unknown>; export declare function useImportResourcePack(): import("@tanstack/react-query").UseMutationResult, unknown>;