@frontmcp/utils 1.6.1 → 1.7.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.
package/esm/index.mjs CHANGED
@@ -137,9 +137,9 @@ async function stat(p) {
137
137
  const fsp = getFsp();
138
138
  return fsp.stat(p);
139
139
  }
140
- async function symlink(target, linkPath) {
140
+ async function symlink(target, linkPath, type) {
141
141
  const fsp = getFsp();
142
- await fsp.symlink(target, linkPath);
142
+ await fsp.symlink(target, linkPath, type);
143
143
  }
144
144
  async function realpath(p) {
145
145
  const fsp = getFsp();
package/fs/fs.d.ts CHANGED
@@ -185,6 +185,8 @@ export declare function ensureDir(p: string): Promise<void>;
185
185
  * if (stats.isDirectory()) { ... }
186
186
  */
187
187
  export declare function stat(p: string): Promise<import('fs').Stats>;
188
+ /** Link type accepted by {@link symlink}; only meaningful on Windows. */
189
+ export type SymlinkType = 'dir' | 'file' | 'junction';
188
190
  /**
189
191
  * Create a symbolic link at `linkPath` pointing to `target`.
190
192
  *
@@ -192,11 +194,15 @@ export declare function stat(p: string): Promise<import('fs').Stats>;
192
194
  *
193
195
  * @param target - Path the symlink should point to
194
196
  * @param linkPath - Where to create the symlink
197
+ * @param type - Windows link type. `dir` and `file` need elevation or Developer
198
+ * Mode there, while `junction` does not (directories only, absolute target).
199
+ * Ignored on POSIX.
195
200
  *
196
201
  * @example
197
202
  * await symlink('/etc/hosts', '/tmp/hosts-link');
203
+ * await symlink(dir, link, process.platform === 'win32' ? 'junction' : 'dir');
198
204
  */
199
- export declare function symlink(target: string, linkPath: string): Promise<void>;
205
+ export declare function symlink(target: string, linkPath: string, type?: SymlinkType): Promise<void>;
200
206
  /**
201
207
  * Resolve a path, following symbolic links to their final target.
202
208
  *
package/fs/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export { readFile, readFileSync, readFileBuffer, writeFile, mkdir, rename, unlink, stat, copyFile, cp, readdir, readdirSync, realpath, rm, mkdtemp, symlink, access, fileExists, readJSON, writeJSON, ensureDir, ensureDirSync, isDirEmpty, runCmd, watchFile, getSpawnFn, } from './fs';
2
- export type { FileWatcherHandle } from './fs';
2
+ export type { FileWatcherHandle, SymlinkType } from './fs';
package/index.js CHANGED
@@ -140,9 +140,9 @@ async function stat(p) {
140
140
  const fsp = getFsp();
141
141
  return fsp.stat(p);
142
142
  }
143
- async function symlink(target, linkPath) {
143
+ async function symlink(target, linkPath, type) {
144
144
  const fsp = getFsp();
145
- await fsp.symlink(target, linkPath);
145
+ await fsp.symlink(target, linkPath, type);
146
146
  }
147
147
  async function realpath(p) {
148
148
  const fsp = getFsp();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontmcp/utils",
3
- "version": "1.6.1",
3
+ "version": "1.7.0",
4
4
  "description": "Shared utility functions for FrontMCP - string manipulation, URI handling, path utilities, and more",
5
5
  "author": "AgentFront <info@agentfront.dev>",
6
6
  "license": "Apache-2.0",
@@ -32,7 +32,7 @@
32
32
  "@noble/hashes": "^2.0.1"
33
33
  },
34
34
  "peerDependencies": {
35
- "@frontmcp/lazy-zod": "1.6.1",
35
+ "@frontmcp/lazy-zod": "1.7.0",
36
36
  "@vercel/kv": "^2.0.0 || ^3.0.0",
37
37
  "ioredis": "^5.0.0"
38
38
  },