Configures continuous file intake for CrestApps.Core AI data sources from local folders, FTP, or SFTP servers. Covers connectors, scheduling, typed knowledge objects, and migration from older indexers.
Ships in crestapps-core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A File AI data source (AIDataSourceSourceTypes.File) is an inert bucket with no folder, credential or field mapping. A file source (FileSource record) picks a connector, configures it, and points at the File data source it fills. Several file sources can feed one knowledge base, each on its own schedule. Web crawlers (crestapps-core-web-crawlers) are the same shape for websites.
FileSource (FileSystem) -+
FileSource (Ftp) -+-> File AI data source -> knowledge-base index (typed objects)
FileSource (Sftp) -+
Each file becomes separately retrievable objects (document, article, text, figure, chart, table) with a page number and a link to its article and document. Data source concepts are in crestapps-core-data-sources; readers and figure processing are in crestapps-core-document-processing.
using CrestApps.Core.AI.Documents;
using CrestApps.Core.AI.Documents.Endpoints;
using CrestApps.Core.AI.FileSources;
using CrestApps.Core.AI.Ftp;
using CrestApps.Core.AI.Sftp;
using CrestApps.Core.Data.YesSql;
builder.Services.AddCrestAppsCore(crestApps => crestApps
.AddAISuite(ai => ai
.AddOpenAI()
.AddDocumentProcessing(documentProcessing => documentProcessing // optional: chat uploads, Office readers
.AddYesSqlStores()
.AddPdf()
.AddReferenceDownloads()))
.AddIndexingServices(indexing => indexing
.AddYesSqlStores()
.AddPostgreSQL(
builder.Configuration.GetSection("CrestApps:PostgreSQL"),
postgreSQL => postgreSQL.AddAIDataSources())));
// After AddDocumentProcessing, so the HTML reader registered here wins .html.
builder.Services
.AddCoreFileSources(builder.Configuration)
.AddCoreFileSystemConnector()
.AddCoreFtpIngestionConnector() // CrestApps.Core.AI.Ftp (FluentFTP)
.AddCoreSftpIngestionConnector(); // CrestApps.Core.AI.Sftp (SSH.NET)
builder.Services.AddCoreFileSourceStoresYesSql(); // or AddCoreFileSourceStoresEntityCore()
var app = builder.Build();
app.AddDownloadKnowledgeFigureEndpoint();
AddCoreFileSources() registers the ingestion path (AddCoreAIDocumentIngestion with the plain-text reader, figure processing and backfill), the shared run service (AddCoreAIIngestionRuntime()), IFileSourceScheduler, FileSourceBackgroundService, the catalog handlers, the HTML reader for .html, .htm and text/html, and the Files entry in AIDataSourceSourceOptions.AddCoreFileSources(IConfiguration) also binds FileSourceOptions and FileSystemConnectorOptions.IFileSourceStore, IIngestionItemStateStore and IKnowledgeObjectStore. YesSql hosts create the tables with CreateFileSourceIndexSchemaAsync, CreateIngestionItemStateIndexSchemaAsync and CreateKnowledgeObjectIndexSchemaAsync (namespace CrestApps.Core.Data.YesSql.Indexes.*).AddCoreAIDocumentReferenceDownloads() (or AddReferenceDownloads()) adds the File citation link resolver. AddDownloadKnowledgeFigureEndpoint() serves ai/knowledge/{dataSourceId}/figures/{canonicalId}, authorized with AIKnowledgeOperations.ViewFigures against the AIDataSource; register an AuthorizationHandler<OperationAuthorizationRequirement, AIDataSource>. Both live in CrestApps.Core.AI.Documents.AddPdf() on the document-processing builder, or services.AddCoreAIPdfIngestion() from CrestApps.Core.AI.Ingestion.Pdf. Office files need AddOpenXml().{
"CrestApps": {
"AI": {
"FileSources": {
"MaxItemsPerRun": 200,
"MaxConcurrentFetches": 2,
"RunCheckIntervalMinutes": 15,
"DefaultRunIntervalMinutes": 1440,
"FileSystem": {
"AllowedRoots": [ "App_Data/file-sources" ]
}
}
}
}
}
FileSystemConnectorOptions.AllowedRoots is empty by default, which means no folder may be read. Registering the connector grants nothing.FileSystemConnectorOptions.BasePath, which the configuration callback sets to the content root... is refused outright in a root and in an item id, containment is compared by path segment, and an item id is re-checked at fetch time.RootPath reads the single allowed root; with several roots it must name one.dotnet user-secrets set "CrestApps:AI:FileSources:FileSystem:AllowedRoots:0" "D:\docs", or the environment variable CrestApps__AI__FileSources__FileSystem__AllowedRoots__0.using CrestApps.Core;
using CrestApps.Core.AI.FileSources.Connectors;
using CrestApps.Core.AI.Ingestion;
using CrestApps.Core.AI.Models;
var dataSource = new AIDataSource
{
DisplayText = "Datasheets",
Source = AIDataSourceSourceTypes.File,
AIKnowledgeBaseIndexProfileName = "datasheets-kb",
};
await dataSourceCatalog.CreateAsync(dataSource, cancellationToken);
var fileSource = new FileSource
{
DisplayText = "Datasheet folder",
Source = FileSystemIngestionConnector.ConnectorName, // "FileSystem", "Ftp" or "Sftp"
AIDataSourceId = dataSource.ItemId,
ReindexIntervalMinutes = 60,
};
fileSource.Put(new FileSystemFileSourceMetadata
{
RootPath = "App_Data/file-sources/datasheets",
Recursive = true,
});
fileSource.Put(new FileSourceMetadata
{
FigureMode = FigureProcessingMode.Auto,
VisionDeploymentName = "gpt-4o", // null means use the application's vision deployment
MaxFigureDescriptionsPerDocument = 25,
MaxItemsPerRun = 500,
Language = "en",
});
await fileSourceStore.CreateAsync(fileSource, cancellationToken);
FTP and SFTP records store a RemoteFileSourceMetadata folder (RootPath default /, Recursive, MaxItems) plus FtpConnectionMetadata or SftpConnectionMetadata with secrets protected by FtpResourceConstants.DataProtectionPurpose or SftpResourceConstants.DataProtectionPurpose (see crestapps-core-mcp-file-resources).
SFTP connections need HostKeyFingerprint (SHA256:..., several comma-separated); without it, or when the server's key differs, the run fails. FTP connections with a user name need EncryptionMode Explicit or Implicit unless the host sets FtpOptions.AllowUnencrypted, and ValidateAnyCertificate needs FtpOptions.AllowAnyCertificate.
Ingestion reads remote files through BoundedRemoteDownload and skips a file larger than the connection's MaxFileBytes (100 MB when not set).
Creating or updating a record from JSON (NewAsync/UpdateAsync with a JsonNode, recipes, deployment imports, APIs) merges the incoming Properties over the stored ones: omitted entries and fields keep their stored values, keys match without regard to case, and an entry sent as null is removed. Admin editors that write metadata with Put behave as before.
Saving validates the connector settings, refuses a data source that is not File or no longer exists, and refuses a vision deployment that does not accept image input.
FileSourceMetadata also has UtilityDeploymentName. A deployment deleted later falls back to the application's own.
FTP and SFTP connections open only the addresses IRemoteFileEgressPolicy returns for the stored host, and SFTP honors the stored proxy fields. When non-administrators can edit file sources, register PublicRemoteFileEgressPolicy to keep these connections off the host's own network (see crestapps-core-mcp-file-resources).
| Service | Does |
|---|---|
IIngestionRunService.RunAsync(source) | one run of one record; returns and stores a FileSourceRunSummary |
IFileSourceScheduler.RunDueAsync() | runs every due source; returns FileSourceSchedulerResult(Considered, Ran, Failed) |
IFileSourceScheduler.GetDueAsync(now) / IsDue(source, now) | lets a host spread work over its own workers |
FileSourceBackgroundService | timer that calls RunDueAsync every RunCheckIntervalMinutes |
The scheduler is scoped and creates no scope. A host with its own scheduler (Orchard Core background tasks, a cron job) resolves it inside its own scope and should remove FileSourceBackgroundService, or sources run twice. Commit the store afterwards (IStoreCommitter.CommitAsync), as the background jobs do; otherwise objects, item state and summaries are discarded with the scope. Due-ness is read from the stored summary, so restarts do not rerun everything.
FileSourceRunSummary stores Status (Running, Succeeded, PartiallyCompleted, Failed), StartedUtc, CompletedUtc, DiscoveryCompleted, DiscoveryCursor, ItemsDiscovered, ItemsIndexed, ItemsSkipped, ItemsDeleted, ItemsFailed, FiguresDiscovered, FiguresPendingDescription and Error. Read it with source.TryGet<FileSourceRunSummary>(out var summary).
IngestionDiscoveryResult.IsComplete = true.MaxItemsPerRun items. When there are more, the connector returns a DiscoveryCursor and the next run resumes; a resumed run is never complete.IngestionItemState) so the next run re-reads everything; it does not delete stored knowledge.Figures found during a run are stored as PendingDescription and transcribed later by the figure backfill job, using the record's vision deployment.
Implement IIngestionConnector (namespace CrestApps.Core.AI.Indexing) and register it with AddCoreIngestionConnector<TConnector>(name, descriptor => ...). The record's Source must equal name. See references/connector-examples.md for a complete connector.
CrestApps.Core.AI.Indexers; it is now CrestApps.Core.AI.FileSources with AddCoreFileSources(), FileSourceOptions, FileSourceRunStatus and the FileSource* stored shapes.CrestApps:AI:FileSources and bind it with AddCoreFileSources(builder.Configuration). The 2.0 changelog says CrestApps:Indexers is still read as a fallback, but the current source falls back to a section literally named CrestApps:File sources, so do not rely on the old name.FileSystemConnectorOptions.AllowedRoots under the FileSystem sub-section. The older FileSourceOptions.AllowedLocalRoots (CrestApps:AI:FileSources:AllowedLocalRoots) is still merged into the allowed roots, so move entries rather than keeping both.Ingested data source type is now File. File sources are their own FileSource records, no longer web crawler records. Hosts with stored preview records move them across.IFileSourceRunService; the shipped interface is IIngestionRunService in CrestApps.Core.AI.Ingestion.CrestApps.Core.AI.Ftp and CrestApps.Core.AI.Sftp. Connector names stored on records are still Ftp and Sftp.Explicit or Implicit encryption (or the matching FtpOptions switch); otherwise runs fail.Properties now takes effect (before, only top-level fields were copied, so FTP and SFTP sources came in without a connection).What SKILL.md sets; muted values are Claude Code's defaults
/crestapps-core:crestapps-core-file-sourcesfrom crestapps-core
npx claudepluginhub crestapps/crestapps.agentskills --plugin crestapps-core51 skills in this plugin
/crestapps-core-a2aSkill for Agent-to-Agent (A2A) protocol support in CrestApps.Core on the A2A 1.0 SDK. Covers AddA2AClient and AddCoreAIA2AClient with Entity Framework Core or YesSql connection stores, A2AConnection and A2AConnectionMetadata authentication, AIProfileA2AMetadata, the agent card cache and A2AToolRegistryProvider, the listAvailableAgents, findAgentForTask and findToolsForTask tools, building an A2A host with IAgentHandler, A2AServer, ITaskStore and MapA2A, A2A 1.0 agent cards with supportedInterfaces published at /.well-known/agent-card.json, A2AHostOptions authentication and ExposeAgentsAsSkill, system agents exposed through the host, and upgrading from the 0.3 SDK./crestapps-core-ag-uiSkill for running the CrestApps.Core 2.0 AI chat as an AG-UI agent. Covers the CrestApps.Core.AI.AGUI package (AGUIRunEventWriter, AGUIRunRequest, AGUIJson), AIChatHubCore.RunAgent over SignalR and MapAGUIChat with Server-Sent Events, the RunAgentInput members and streamed events, tool approvals with RequireApproval or an approval tool kind, ApprovalRequiredAIFunction, interrupts and resume, approvals inside agents, page context with crestAppsAGUI.registerContextProvider, shared state with registerStateProvider and update_shared_state, frontend tools, stored tool calls (ChatTurnToolActivity), runs that continue on the next page, AGUIChatOptions.DisconnectedRunTimeout, the protocol and sendPageContext chat options, and the AICompletionContextKeys and ChatResponseHandlerContext members. Use it when showing tool calls in the chat, asking a person before a tool runs, sharing page state with the agent, connecting CopilotKit or another AG-UI client, or troubleshooting approvals and continued runs.Other plugins' skills for the same job