Skip to content

Commit c671d3e

Browse files
committed
feat(collections): pf-4401 process spawn, ipc
1 parent 95ade3d commit c671d3e

8 files changed

Lines changed: 1158 additions & 6 deletions

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"type": "module",
77
"imports": {
88
"~docsCatalog": "./src/docs.json",
9+
"#collectionsHost": "./dist/server.collectionsHost.js",
910
"#toolsHost": "./dist/server.toolsHost.js"
1011
},
1112
"exports": {

src/options.collections.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { type ToolOptions, setToolOptions } from './options.tools';
2+
3+
/**
4+
* Options for records. A limited subset of options.
5+
*
6+
* @alias ToolOptions
7+
*/
8+
type CollectionOptions = ToolOptions;
9+
10+
/**
11+
* Return a refined set of options from global options for records.
12+
*
13+
* @alias setToolOptions
14+
*/
15+
const setCollectionOptions = setToolOptions;
16+
17+
export { setCollectionOptions, type CollectionOptions };

src/options.defaults.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { basename, resolve } from 'node:path';
22
import { pathToFileURL } from 'node:url';
33
import packageJson from '../package.json';
44
import { type ToolModule } from './server.toolsUser';
5+
import { type CollectionModule } from './collections.user';
56
import { getNodeMajorVersion } from './options.helpers';
67

78
/**
@@ -47,6 +48,8 @@ import { getNodeMajorVersion } from './options.helpers';
4748
* @property {typeof TOOL_MEMO_OPTIONS} toolMemoOptions - Tool-specific memoization options.
4849
* @property {ToolModule|ToolModule[]} toolModules - Array of external tool modules (ESM specs or paths) to be loaded and
4950
* registered with the server.
51+
* @property {CollectionModule|CollectionModule[]} collectionModules - Array of external collection modules
52+
* (ESM specs or paths) to be loaded and registered with the server.
5053
* @property urlRegex - Regular expression pattern for URL matching.
5154
* @property version - Version of the package.
5255
* @property whitelist - Central outbound-URL policy options.
@@ -83,6 +86,7 @@ interface DefaultOptions<TLogOptions = LoggingOptions> {
8386
stats: StatsOptions;
8487
toolMemoOptions: Partial<typeof TOOL_MEMO_OPTIONS>;
8588
toolModules: ToolModule | ToolModule[];
89+
collectionModules: CollectionModule | CollectionModule[];
8690
urlRegex: RegExp;
8791
version: string;
8892
whitelist: WhitelistOptions;
@@ -560,6 +564,7 @@ const DEFAULT_OPTIONS: DefaultOptions = {
560564
resourceModules: [],
561565
toolMemoOptions: TOOL_MEMO_OPTIONS,
562566
toolModules: [],
567+
collectionModules: [],
563568
separator: DEFAULT_SEPARATOR,
564569
urlRegex: URL_REGEX,
565570
version: (process.env.NODE_ENV === 'local' && '0.0.0') || packageJson.version,

0 commit comments

Comments
 (0)