@vite-hub/source 0.0.3 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +302 -31
  3. package/dist/auth-B-tX_rp0.js +1426 -0
  4. package/dist/client-BwstxtdY.js +8280 -0
  5. package/dist/client.d.ts +49 -0
  6. package/dist/client.js +179 -0
  7. package/dist/collection-B_4w_J8h.d.ts +257 -0
  8. package/dist/collection-cursor-WzV1Jd6v.js +124 -0
  9. package/dist/collection-route-BplWPxHR.js +10 -0
  10. package/dist/drizzle.d.ts +41 -0
  11. package/dist/drizzle.js +89 -0
  12. package/dist/error-diagnostics-X0kuFjBT.js +51 -0
  13. package/dist/file-BX0FSvgE.js +60 -0
  14. package/dist/file-DadN9dbN.d.ts +19 -0
  15. package/dist/file.d.ts +2 -0
  16. package/dist/file.js +2 -0
  17. package/dist/files.d.ts +15 -0
  18. package/dist/files.js +38 -0
  19. package/dist/github.d.ts +20 -0
  20. package/dist/github.js +1332 -0
  21. package/dist/glob-BmFqTvJY.js +993 -0
  22. package/dist/glob.d.ts +23 -0
  23. package/dist/glob.js +2 -0
  24. package/dist/index.d.ts +165 -172
  25. package/dist/index.js +600 -1113
  26. package/dist/markdown.d.ts +5 -0
  27. package/dist/markdown.js +10 -0
  28. package/dist/mcp.d.ts +151 -0
  29. package/dist/mcp.js +497 -0
  30. package/dist/mrmime-40h5OOIp.js +448 -0
  31. package/dist/path-BS8rYm0n.js +1956 -0
  32. package/dist/path-DOBpV8ol.js +32 -0
  33. package/dist/server.d.ts +265 -0
  34. package/dist/server.js +149 -0
  35. package/dist/sse-D9gqqNPj.js +448 -0
  36. package/dist/streamableHttp-BL-E7pl5.js +509 -0
  37. package/dist/types-BigOktIj.d.ts +93 -0
  38. package/dist/types-CoWcW8oz.js +7590 -0
  39. package/dist/vite.d.ts +162 -0
  40. package/dist/vite.js +2284 -0
  41. package/package.json +102 -17
  42. package/tsconfig.vite.json +6 -0
  43. package/types/source/fallback.d.ts +1 -0
  44. package/types/source/index.d.ts +1 -0
package/dist/glob.d.ts ADDED
@@ -0,0 +1,23 @@
1
+ import { t as FileSource } from "./types-BigOktIj.js";
2
+ //#region src/sources/glob.d.ts
3
+ interface GlobSourceOptions {
4
+ cwd?: string;
5
+ dot?: boolean;
6
+ followSymlinks?: boolean;
7
+ /** Portable glob patterns: backslashes are separators, never escapes. Use [*], [?], [[] for literals. */
8
+ include: string | string[];
9
+ /** Uses the same portable separator and literal syntax as include. */
10
+ ignore?: string | readonly string[];
11
+ keyCache?: boolean;
12
+ prefix?: string;
13
+ }
14
+ /** A pattern such as `content/docs/**\/*.md`, or the options. */
15
+ type GlobInput = string | GlobSourceOptions;
16
+ /**
17
+ * Project files that match a pattern, such as `glob("content/docs/**\/*.md")`. Under `vite dev` they are read from
18
+ * disk, so new files show up at once. A ViteHub build bundles a call with literal options into the server, so hosts
19
+ * without a file system, such as Cloudflare Workers, serve the same files.
20
+ */
21
+ export declare function glob(input: GlobInput): FileSource<string>;
22
+ //#endregion
23
+ export type { GlobInput, GlobSourceOptions };
package/dist/glob.js ADDED
@@ -0,0 +1,2 @@
1
+ import { n as glob } from "./glob-BmFqTvJY.js";
2
+ export { glob };
package/dist/index.d.ts CHANGED
@@ -1,182 +1,175 @@
1
+ import { C as ProviderCollectionPage, D as CollectionCursorError, E as defineCollection, O as CollectionCursorErrorOptions, S as ProviderCollectionOptions, T as SourceCollectionOptions, _ as CollectionReadOptions, a as CollectionCursorValue, b as CursorCollectionSource, c as CollectionItem, d as CollectionOptions, f as CollectionPage, g as CollectionQueryInput, h as CollectionQueryBuilder, i as CollectionClientItem, k as CollectionCursorErrorReason, l as CollectionLoadOptions, m as CollectionQuery, n as AnyCollectionSource, o as CollectionFacetValue, p as CollectionPageOptions, r as Collection, s as CollectionFacets, t as AnyCollection, u as CollectionLoader, v as CollectionRequestQuery, w as ProviderCollectionSource, x as ProviderCollectionLoader, y as CollectionSource } from "./collection-B_4w_J8h.js";
2
+ import { _ as SourceName, a as Source, c as SourceContext, d as SourceFile, f as SourceItem, g as SourceMetadata, h as SourceMap, i as RegisteredSource, l as SourceData, m as SourceListEntry, n as ReadSourceOptions, o as SourceCacheOptions, p as SourceKey, r as ReadSourceResult, s as SourceContent, t as FileSource, u as SourceEntry, v as SourceReader, y as SourceRevision } from "./types-BigOktIj.js";
1
3
  import { ViteHubError } from "@vite-hub/runtime";
2
- import { Client } from "@modelcontextprotocol/sdk/client/index.js";
3
- import { SSEClientTransportOptions } from "@modelcontextprotocol/sdk/client/sse.js";
4
- import { StreamableHTTPClientTransportOptions } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
5
- import { RequestOptions } from "@modelcontextprotocol/sdk/shared/protocol.js";
6
- import { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
7
- import { BlobResourceContents, Resource, TextResourceContents } from "@modelcontextprotocol/sdk/types.js";
8
-
9
- //#region src/core/types.d.ts
10
- type SourceContent = string | Uint8Array;
11
- interface ReadSourceOptions {
12
- encoding?: "utf8" | "binary";
13
- }
14
- type ReadSourceResult<TOptions extends ReadSourceOptions | undefined = undefined> = TOptions extends {
15
- encoding: "binary";
16
- } ? Uint8Array : string;
17
- interface SourceContext {
18
- abortSignal?: AbortSignal;
19
- rootDir: string;
20
- sourceRootDir?: string;
21
- source?: string;
22
- workspace?: string;
23
- }
24
- interface SourceCacheOptions {
25
- maxAge?: number;
26
- }
27
- interface SourceSearchQuery {
28
- pattern: string;
29
- cwd?: string;
30
- paths?: string[];
31
- regex?: boolean;
32
- caseSensitive?: boolean;
33
- limit?: number;
34
- }
35
- interface SourceSearchHit {
36
- path: string;
37
- line: number;
38
- column: number;
39
- text: string;
40
- }
41
- interface SourceItem<TKey extends string = string, TData = unknown, TMetadata extends object = Record<string, unknown>> {
42
- key: TKey;
43
- path?: string;
44
- content?: SourceContent;
45
- data?: TData;
46
- mediaType?: string;
47
- metadata?: TMetadata;
48
- }
49
- interface Source<TKey extends string = string, TData = unknown, TMetadata extends object = Record<string, unknown>> {
50
- name: string;
51
- cache?: false | SourceCacheOptions;
52
- fingerprint?: unknown;
53
- prepare?(ctx: SourceContext): Promise<void>;
54
- getKeys(ctx: SourceContext): Promise<TKey[]>;
55
- getItem(key: TKey, ctx: SourceContext): Promise<SourceItem<TKey, TData, TMetadata>>;
56
- getItems?(ctx: SourceContext): Promise<SourceItem<TKey, TData, TMetadata>[]>;
57
- getMeta?(key: TKey, ctx: SourceContext): Promise<TMetadata | undefined>;
58
- search?(query: SourceSearchQuery, ctx: SourceContext): Promise<SourceSearchHit[]>;
59
- watch?: unknown[];
60
- }
61
- interface SourceListEntry<TKey extends string = string> {
62
- key: TKey;
63
- type: "file" | "directory";
64
- }
65
- declare global {
66
- interface ViteHubSourceMap {}
67
- }
68
- interface SourceMap extends ViteHubSourceMap {}
69
- type SourceKeyOf<TSource> = TSource extends Source<infer TKey, any, any> ? TKey : string;
70
- type SourceDataOf<TSource> = TSource extends Source<any, infer TData, any> ? TData : unknown;
71
- type SourceMetadataOf<TSource> = TSource extends Source<any, any, infer TMetadata> ? TMetadata : Record<string, unknown>;
72
- type RegisteredSource<TName extends SourceName> = TName extends keyof ViteHubSourceMap ? ViteHubSourceMap[TName] : Source;
73
- type SourceName = [keyof ViteHubSourceMap] extends [never] ? string : Extract<keyof ViteHubSourceMap, string>;
74
- type SourceKey<TName extends SourceName = SourceName> = Extract<SourceKeyOf<RegisteredSource<TName>>, string>;
75
- type SourceData<TName extends SourceName = SourceName> = SourceDataOf<RegisteredSource<TName>>;
76
- type SourceMetadata<TName extends SourceName = SourceName> = SourceMetadataOf<RegisteredSource<TName>>;
77
- interface SourceReader<TName extends SourceName = SourceName> {
78
- keys(): Promise<SourceKey<TName>[]>;
79
- get(key: SourceKey<TName>): Promise<SourceItem<SourceKey<TName>, SourceData<TName>, SourceMetadata<TName>>>;
80
- items(): Promise<Array<SourceItem<SourceKey<TName>, SourceData<TName>, SourceMetadata<TName>>>>;
81
- read<TOptions extends ReadSourceOptions | undefined = undefined>(key: SourceKey<TName>, options?: TOptions): Promise<ReadSourceResult<TOptions>>;
82
- meta(key: SourceKey<TName>): Promise<SourceMetadata<TName> | undefined>;
83
- exists(key: SourceKey<TName>): Promise<boolean>;
84
- list(prefix?: SourceKey<TName> | (string & {}) | ""): Promise<SourceListEntry<SourceKey<TName>>[]>;
85
- }
4
+ import { StandardSchemaV1 } from "@standard-schema/spec";
5
+ //#region src/core/array-collection.d.ts
6
+ interface ArrayCollectionSort {
7
+ direction?: "asc" | "desc";
8
+ /** Field path to sort by. Numbers sort numerically; other values sort as strings. */
9
+ field: string;
10
+ }
11
+ interface ArrayCollectionOptions<TFilter extends string = string> {
12
+ /**
13
+ * Field paths clients may filter by. `?category=guide` matches case-insensitively, a repeated key matches any of
14
+ * its values, and `?empty=category` matches items with no value at that path. Dot paths read nested objects and
15
+ * every element of nested arrays.
16
+ */
17
+ filters?: readonly TFilter[];
18
+ /** Field paths that the `search` query matches as a case-insensitive substring. Omit to reject `search`. */
19
+ search?: readonly string[];
20
+ /** Order of every page. Omit to keep the array order. */
21
+ sort?: ArrayCollectionSort;
22
+ /** Field paths counted into `page.facets` over every matching item. */
23
+ facets?: readonly string[];
24
+ /** Field path that `collection.get(key)` matches. Omit to leave the Collection without `get()`. */
25
+ key?: string;
26
+ /** Page size when the caller omits `limit` (default `50`). */
27
+ defaultLimit?: number;
28
+ /** Largest accepted `limit` and the most values kept per facet (default `100`). */
29
+ maxLimit?: number;
30
+ }
31
+ /** Items plus an optional content digest. Without `digest`, the Collection hashes the items to bind its cursors. */
32
+ interface ArrayCollectionSnapshot<TItem> {
33
+ digest?: string;
34
+ items: readonly TItem[];
35
+ }
36
+ type ArrayCollectionLoader<TItem> = (options: {
37
+ signal?: AbortSignal;
38
+ }) => Promise<readonly TItem[] | ArrayCollectionSnapshot<TItem>> | readonly TItem[] | ArrayCollectionSnapshot<TItem>;
39
+ /** Request query accepted by an array Collection route and by `useCollection({ filter })`. */
40
+ type ArrayCollectionQueryInput<TFilter extends string = string> = { [TKey in TFilter]?: string | readonly string[]; } & {
41
+ empty?: TFilter | readonly TFilter[];
42
+ search?: string;
43
+ };
44
+ /** Parsed query that an array Collection evaluates. Values match case-insensitively. */
45
+ type ArrayCollectionQuery<TFilter extends string = string> = { [TKey in TFilter]?: readonly string[]; } & {
46
+ empty?: readonly TFilter[];
47
+ search?: string;
48
+ };
49
+ /**
50
+ * A Collection source that filters, searches, sorts, counts, and pages an array in memory.
51
+ *
52
+ * `load` runs on every request, so keep the array bounded. Cursors are bound to the data digest and the query:
53
+ * a cursor from changed data or another query is rejected as stale (`409` on the generated route).
54
+ *
55
+ * Pass `schema` to validate every item on load and type the items from its output.
56
+ *
57
+ * @example
58
+ * export const articles = defineCollection({
59
+ * source: array(() => loadArticles(), { filters: ['category'], search: ['title'], facets: ['category'] }),
60
+ * })
61
+ */
62
+ export declare function array<TSchema extends StandardSchemaV1, const TFilter extends string = never>(load: readonly unknown[] | ArrayCollectionLoader<unknown>, options: ArrayCollectionOptions<TFilter> & {
63
+ schema: TSchema;
64
+ }): ProviderCollectionSource<StandardSchemaV1.InferOutput<TSchema>, ArrayCollectionQuery<TFilter>, ArrayCollectionQueryInput<TFilter>>;
65
+ export declare function array<TItem, const TFilter extends string = never>(load: readonly TItem[] | ArrayCollectionLoader<TItem>, options?: ArrayCollectionOptions<TFilter> & {
66
+ schema?: undefined;
67
+ }): ProviderCollectionSource<TItem, ArrayCollectionQuery<TFilter>, ArrayCollectionQueryInput<TFilter>>;
68
+ //#endregion
69
+ //#region src/core/combine-sources.d.ts
70
+ interface CombinedSourceReader {
71
+ get(key: never): Promise<unknown>;
72
+ items?(): Promise<Array<{
73
+ key: string;
74
+ }>>;
75
+ }
76
+ type CombinedSources = Record<string, CombinedSourceReader>;
77
+ type CombinedSourceKeyFunction<TReader> = TReader extends {
78
+ get(key: infer TKey): Promise<unknown>;
79
+ } ? (key: TKey) => void : never;
80
+ type CombinedSourceKey<TReader> = CombinedSourceKeyFunction<TReader> extends ((key: infer TKey) => void) ? Extract<TKey, string> : never;
81
+ type CombinedSourceValue<TReader> = TReader extends {
82
+ get(key: never): Promise<infer TValue>;
83
+ } ? TValue : never;
84
+ type CombinedSourceItem<TReader> = TReader extends {
85
+ items(): Promise<Array<infer TItem extends {
86
+ key: string;
87
+ }>>;
88
+ } ? TItem : never;
89
+ type Equal<TLeft, TRight> = (<T>(_value?: T) => T extends TLeft ? 1 : 2) extends (<T>(_value?: T) => T extends TRight ? 1 : 2) ? (<T>(_value?: T) => T extends TRight ? 1 : 2) extends (<T>(_value?: T) => T extends TLeft ? 1 : 2) ? true : false : false;
90
+ type ValidCombinedGet<TReader> = TReader extends unknown ? TReader extends {
91
+ get: infer TGet;
92
+ } ? Equal<TGet, (key: CombinedSourceKey<TReader>) => Promise<CombinedSourceValue<TReader>>> extends true ? TReader : never : never : never;
93
+ type ValidCombinedSource<TReader> = [CombinedSourceItem<TReader>] extends [never] ? ValidCombinedGet<TReader> : Exclude<CombinedSourceItem<TReader>["key"], CombinedSourceKey<TReader>> extends never ? ValidCombinedGet<TReader> : never;
94
+ type ValidCombinedSources<TSources extends CombinedSources> = { [TSource in keyof TSources]: ValidCombinedSource<TSources[TSource]>; };
95
+ type TaggedCombinedItemVariant<TSource extends string, TItem> = TItem extends {
96
+ key: string;
97
+ } ? Omit<TItem, "identity" | "source"> & {
98
+ identity: readonly [TSource, TItem["key"]];
99
+ source: TSource;
100
+ } : never;
101
+ type TaggedCombinedItem<TSource extends string, TReader> = TaggedCombinedItemVariant<TSource, CombinedSourceItem<TReader>>;
102
+ type CombinedItem<TSources extends CombinedSources> = { [TSource in Extract<keyof TSources, string>]: TaggedCombinedItem<TSource, TSources[TSource]>; }[Extract<keyof TSources, string>];
103
+ type CombinedIdentity<TSources extends CombinedSources> = { [TSource in Extract<keyof TSources, string>]: readonly [source: TSource, key: CombinedSourceKey<TSources[TSource]>]; }[Extract<keyof TSources, string>];
104
+ type CombinedIdentityValue<TSources extends CombinedSources, TIdentity> = TIdentity extends readonly [infer TSource extends Extract<keyof TSources, string>, string] ? CombinedSourceValue<TSources[TSource]> : never;
105
+ interface CombinedSourcesDefinition<TSources extends CombinedSources> {
106
+ readonly sources: TSources & ValidCombinedSources<TSources> & Record<Exclude<keyof TSources, string>, never>;
107
+ }
108
+ type CombinedSourcesReader<TSources extends CombinedSources> = {
109
+ get<const TIdentity extends CombinedIdentity<TSources>>(identity: TIdentity): Promise<CombinedIdentityValue<TSources, TIdentity>>;
110
+ } & (TSources[keyof TSources] extends {
111
+ items(): Promise<Array<{
112
+ key: string;
113
+ }>>;
114
+ } ? {
115
+ items(): Promise<Array<CombinedItem<TSources>>>;
116
+ } : {});
117
+ export declare function combineSources<const TSources extends CombinedSources>(definition: CombinedSourcesDefinition<TSources>): CombinedSourcesReader<TSources>;
118
+ //#endregion
119
+ //#region src/core/split-source.d.ts
120
+ /** One part of a parent item. Its key is unique inside the parent and has no `#`. */
121
+ type SplitSourcePart = SourceItem<string, unknown, object>;
122
+ interface SplitSourceOptions<TSource extends Source, TPart extends SplitSourcePart> {
123
+ /** The Source whose items are split. */
124
+ source: TSource;
125
+ /** Defaults to the parent Source name. */
126
+ name?: string;
127
+ /** Returns the parts of one parent item, in order. Return an empty array to skip the item. */
128
+ split(item: SourceEntry<TSource>): readonly TPart[] | Promise<readonly TPart[]>;
129
+ }
130
+ /** A part's key: the parent key, `#`, and the part key. */
131
+ type SplitSourceKey<TSource extends Source> = `${SourceKey<TSource>}#${string}`;
132
+ /** A part as the split Source returns it: its full key, and the parent's path when the part has none. */
133
+ type SplitSourceItem<TSource extends Source, TPart extends SplitSourcePart> = Omit<TPart, "key"> & {
134
+ key: SplitSourceKey<TSource>;
135
+ };
136
+ /** A Source with one item for each part of another Source's items. */
137
+ type SplitSourceMeta<TSource extends Source> = NonNullable<TSource["getMeta"]> extends ((...args: any[]) => infer TResult) ? TResult : Promise<undefined>;
138
+ type SplitSource<TSource extends Source, TPart extends SplitSourcePart> = Omit<Source<SplitSourceKey<TSource>>, "getItem" | "getItems" | "getMeta"> & {
139
+ getItem(key: SplitSourceKey<TSource>, ctx: SourceContext): Promise<SplitSourceItem<TSource, TPart>>;
140
+ getItems(ctx: SourceContext): Promise<SplitSourceItem<TSource, TPart>[]>;
141
+ getMeta(key: SplitSourceKey<TSource>, ctx: SourceContext): SplitSourceMeta<TSource>;
142
+ };
143
+ /** Split each item of a Source into parts, such as the sections of a Markdown file. Each part is an item. */
144
+ export declare function splitSource<const TSource extends Source, TPart extends SplitSourcePart>(options: SplitSourceOptions<TSource, TPart>): SplitSource<TSource, TPart>;
86
145
  //#endregion
87
146
  //#region src/core/define.d.ts
88
- declare function defineSource<const TSource extends Source>(source: TSource): TSource;
89
- declare function defineSources<const TSources extends Record<string, Source>>(sources: TSources): TSources;
147
+ /** Define a loader. Open it with createSource() to bind its runtime context. */
148
+ export declare function defineSource<const TSource extends Source>(source: TSource): TSource;
149
+ export declare function defineSources<const TSources extends Record<string, Source>>(sources: TSources): TSources;
150
+ //#endregion
151
+ //#region src/core/reader.d.ts
152
+ export declare function createSource<const TSource extends Source>(source: TSource, context?: Partial<SourceContext>): SourceReader<TSource>;
90
153
  //#endregion
91
154
  //#region src/core/registry.d.ts
92
- declare function registerSource<const TName extends string, const TSource extends Source>(name: TName, source: TSource): TSource;
93
- declare function registerSources<const TSources extends Record<string, Source>>(sources: TSources): TSources;
94
- declare function getRegisteredSource<TName extends SourceName>(name: TName): Source<SourceKey<TName>, SourceData<TName>, SourceMetadata<TName>>;
95
- declare function clearSources(): void;
96
- declare function useSource<TName extends SourceName>(name: TName, context?: Partial<SourceContext>): SourceReader<TName>;
155
+ export declare function registerSource<const TName extends string, const TSource extends Source>(name: TName, source: TSource): TSource;
156
+ export declare function registerSources<const TSources extends Record<string, Source>>(sources: TSources): TSources;
157
+ export declare function getRegisteredSource<TName extends SourceName>(name: TName): RegisteredSource<TName>;
158
+ export declare function clearSources(): void;
159
+ /** Open a registered definition with the same lifecycle as direct Source readers. */
160
+ export declare function useSource<TName extends SourceName>(name: TName, context?: Partial<SourceContext>): SourceReader<RegisteredSource<TName>>;
97
161
  //#endregion
98
162
  //#region src/core/errors.d.ts
99
163
  type SourceErrorCode = "SOURCE_FAILED" | "SOURCE_NOT_FOUND" | "SOURCE_PATH_INVALID";
100
164
  //#endregion
101
- //#region src/sources/custom.d.ts
102
- declare function custom<const TSource extends Source>(source: TSource): TSource;
103
- //#endregion
104
- //#region src/sources/file.d.ts
105
- interface FileSourcePathOptions<TKey extends string = string> {
106
- path: string;
107
- workspacePath?: TKey;
108
- content?: never;
109
- mediaType?: string;
110
- }
111
- interface FileSourceInlineOptions<TKey extends string = string> {
112
- workspacePath: TKey;
113
- content: SourceContent;
114
- mediaType?: string;
115
- path?: never;
116
- }
117
- type FileSourceOptions<TKey extends string = string> = FileSourcePathOptions<TKey> | FileSourceInlineOptions<TKey>;
118
- type FileSourceInput<TKey extends string = string> = FileSourceOptions<TKey> | TKey;
119
- declare function file<const TKey extends string = string>(input: FileSourceInput<TKey>): Source<TKey>;
120
- //#endregion
121
- //#region src/sources/github/types.d.ts
122
- interface GitHubSourceOptions {
123
- repo: string;
124
- ref?: string;
125
- root?: string;
126
- auth?: false | string | (() => string | undefined);
127
- include?: string | string[];
128
- exclude?: string | string[];
129
- cache?: false | SourceCacheOptions;
130
- }
131
- //#endregion
132
- //#region src/sources/github/index.d.ts
133
- declare function github<const TKey extends string = string>(options: GitHubSourceOptions): Source<TKey>;
134
- //#endregion
135
- //#region src/sources/glob.d.ts
136
- interface GlobSourceOptions {
137
- cwd?: string;
138
- dot?: boolean;
139
- followSymlinks?: boolean;
140
- include: string | string[];
141
- ignore?: string | string[];
142
- keyCache?: boolean;
143
- prefix?: string;
144
- }
145
- declare function glob<const TKey extends string = string>(options: GlobSourceOptions): Source<TKey>;
146
- //#endregion
147
- //#region src/sources/markdown.d.ts
148
- declare function markdown<const TKey extends string = string>(options: FileSourceOptions<TKey>): Source<TKey>;
149
- //#endregion
150
- //#region src/sources/mcp-resources.d.ts
151
- type McpResourcesRequestOptions = RequestOptions;
152
- type McpResourceDescriptor = Resource;
153
- type McpResourceContent = TextResourceContents | BlobResourceContents;
154
- interface McpResourcesClient {
155
- close?: () => void | Promise<void>;
156
- getServerVersion?: Client["getServerVersion"];
157
- listResources: Client["listResources"];
158
- readResource: Client["readResource"];
159
- serverInfo?: unknown;
160
- }
161
- type McpResourcesTransportConfig = Transport | ({
162
- type?: "http";
163
- url: string | URL;
164
- } & StreamableHTTPClientTransportOptions) | ({
165
- type: "sse";
166
- url: string | URL;
167
- } & SSEClientTransportOptions);
168
- interface McpResourcesClientConfig {
169
- transport: McpResourcesTransportConfig;
170
- }
171
- type McpResourcesServer = McpResourcesClient | McpResourcesClientConfig | ((ctx: SourceContext) => McpResourcesClient | McpResourcesClientConfig | Promise<McpResourcesClient | McpResourcesClientConfig>);
172
- interface McpResourcesSourceOptions<TKey extends string = string> {
173
- cache?: false | SourceCacheOptions;
174
- exclude?: string | string[];
175
- include?: string | string[];
176
- path?: (resource: McpResourceDescriptor) => TKey | string | undefined;
177
- request?: McpResourcesRequestOptions;
178
- server: McpResourcesServer;
179
- }
180
- declare function mcpResources<const TKey extends string = string>(options: McpResourcesSourceOptions<TKey>): Source<TKey>;
165
+ //#region src/ignores.d.ts
166
+ export declare const sourceIgnores: Readonly<{
167
+ defaults: readonly string[];
168
+ dependencies: readonly string[];
169
+ generated: readonly string[];
170
+ media: readonly string[];
171
+ secrets: readonly string[];
172
+ system: readonly string[];
173
+ }>;
181
174
  //#endregion
182
- export { type FileSourceInlineOptions, type FileSourceOptions, type FileSourcePathOptions, type GitHubSourceOptions, type GlobSourceOptions, type McpResourceContent, type McpResourceDescriptor, type McpResourcesClient, type McpResourcesClientConfig, type McpResourcesRequestOptions, type McpResourcesServer, type McpResourcesSourceOptions, type McpResourcesTransportConfig, type ReadSourceOptions, type ReadSourceResult, type Source, type SourceCacheOptions, type SourceContent, type SourceContext, type SourceData, type SourceErrorCode, type SourceItem, type SourceKey, type SourceListEntry, type SourceMap, type SourceMetadata, type SourceName, type SourceReader, type SourceSearchHit, type SourceSearchQuery, clearSources, custom, defineSource, defineSources, file, getRegisteredSource, github, glob, markdown, mcpResources, registerSource, registerSources, useSource };
175
+ export { type AnyCollection, type AnyCollectionSource, type ArrayCollectionLoader, type ArrayCollectionOptions, type ArrayCollectionQuery, type ArrayCollectionQueryInput, type ArrayCollectionSnapshot, type ArrayCollectionSort, type Collection, type CollectionClientItem, CollectionCursorError, type CollectionCursorErrorOptions, type CollectionCursorErrorReason, type CollectionCursorValue, type CollectionFacetValue, type CollectionFacets, type CollectionItem, type CollectionLoadOptions, type CollectionLoader, type CollectionOptions, type CollectionPage, type CollectionPageOptions, type CollectionQuery, type CollectionQueryBuilder, type CollectionQueryInput, type CollectionReadOptions, type CollectionRequestQuery, type CollectionSource, type CursorCollectionSource, type FileSource, type ProviderCollectionLoader, type ProviderCollectionOptions, type ProviderCollectionPage, type ProviderCollectionSource, type ReadSourceOptions, type ReadSourceResult, type RegisteredSource, type Source, type SourceCacheOptions, type SourceCollectionOptions, type SourceContent, type SourceContext, type SourceData, type SourceEntry, type SourceErrorCode, type SourceFile, type SourceItem, type SourceKey, type SourceListEntry, type SourceMap, type SourceMetadata, type SourceName, type SourceReader, type SourceRevision, type SplitSource, type SplitSourceItem, type SplitSourceKey, type SplitSourceOptions, type SplitSourcePart, defineCollection };