@pinepaper.studio/mcp-server 1.6.24 → 1.6.26
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/README.md +167 -20
- package/SECURITY.md +15 -1
- package/dist/browser/puppeteer-controller.d.ts +7 -1
- package/dist/browser/puppeteer-controller.d.ts.map +1 -1
- package/dist/browser/puppeteer-controller.js +151 -69
- package/dist/browser/puppeteer-controller.js.map +1 -1
- package/dist/build-info.json +2 -2
- package/dist/cli.js +7 -5
- package/dist/cli.js.map +1 -1
- package/dist/design/design-systems.js +2 -2
- package/dist/design/design-systems.js.map +1 -1
- package/dist/i18n/locales/en.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +51 -11
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.d.ts +5 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +5 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/server.d.ts +86 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +159 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/stdio.d.ts +20 -0
- package/dist/mcp/stdio.d.ts.map +1 -0
- package/dist/mcp/stdio.js +82 -0
- package/dist/mcp/stdio.js.map +1 -0
- package/dist/mcp/types.d.ts +598 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +140 -0
- package/dist/mcp/types.js.map +1 -0
- package/dist/metrics/performance-tracker.d.ts.map +1 -1
- package/dist/metrics/performance-tracker.js +4 -3
- package/dist/metrics/performance-tracker.js.map +1 -1
- package/dist/ontology/hints.d.ts.map +1 -1
- package/dist/ontology/hints.js +3 -1
- package/dist/ontology/hints.js.map +1 -1
- package/dist/ontology/upstream-vocabulary.d.ts +2 -2
- package/dist/ontology/upstream-vocabulary.d.ts.map +1 -1
- package/dist/ontology/upstream-vocabulary.js +8 -2
- package/dist/ontology/upstream-vocabulary.js.map +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/tools/batch-macros.d.ts.map +1 -1
- package/dist/tools/batch-macros.js +2 -1
- package/dist/tools/batch-macros.js.map +1 -1
- package/dist/tools/compact-descriptions.d.ts.map +1 -1
- package/dist/tools/compact-descriptions.js +7 -6
- package/dist/tools/compact-descriptions.js.map +1 -1
- package/dist/tools/craft-tools.d.ts +1 -1
- package/dist/tools/craft-tools.d.ts.map +1 -1
- package/dist/tools/create-known-keys.d.ts +2 -0
- package/dist/tools/create-known-keys.d.ts.map +1 -0
- package/dist/tools/create-known-keys.js +24 -0
- package/dist/tools/create-known-keys.js.map +1 -0
- package/dist/tools/definitions.d.ts +3 -1
- package/dist/tools/definitions.d.ts.map +1 -1
- package/dist/tools/definitions.js +43 -22
- package/dist/tools/definitions.js.map +1 -1
- package/dist/tools/effect-check.d.ts +1 -1
- package/dist/tools/effect-check.d.ts.map +1 -1
- package/dist/tools/effect-check.js +4 -0
- package/dist/tools/effect-check.js.map +1 -1
- package/dist/tools/engine-lists.d.ts +4 -1
- package/dist/tools/engine-lists.d.ts.map +1 -1
- package/dist/tools/engine-lists.js +9 -1
- package/dist/tools/engine-lists.js.map +1 -1
- package/dist/tools/engine-methods.d.ts.map +1 -1
- package/dist/tools/engine-methods.js +1 -0
- package/dist/tools/engine-methods.js.map +1 -1
- package/dist/tools/engine-surface.d.ts +1 -1
- package/dist/tools/engine-surface.d.ts.map +1 -1
- package/dist/tools/engine-surface.js +19 -4
- package/dist/tools/engine-surface.js.map +1 -1
- package/dist/tools/export-file-receipt.d.ts +12 -0
- package/dist/tools/export-file-receipt.d.ts.map +1 -1
- package/dist/tools/export-file-receipt.js +29 -2
- package/dist/tools/export-file-receipt.js.map +1 -1
- package/dist/tools/handlers/beats.d.ts +1 -1
- package/dist/tools/handlers/beats.d.ts.map +1 -1
- package/dist/tools/handlers/camera.d.ts +1 -1
- package/dist/tools/handlers/camera.d.ts.map +1 -1
- package/dist/tools/handlers/export.d.ts +1 -1
- package/dist/tools/handlers/export.d.ts.map +1 -1
- package/dist/tools/handlers/export.js +3 -2
- package/dist/tools/handlers/export.js.map +1 -1
- package/dist/tools/handlers/font.d.ts +1 -1
- package/dist/tools/handlers/font.d.ts.map +1 -1
- package/dist/tools/handlers/font.js +8 -7
- package/dist/tools/handlers/font.js.map +1 -1
- package/dist/tools/handlers/generate.d.ts +1 -1
- package/dist/tools/handlers/generate.d.ts.map +1 -1
- package/dist/tools/handlers/generate.js +4 -3
- package/dist/tools/handlers/generate.js.map +1 -1
- package/dist/tools/handlers/maps.d.ts +1 -1
- package/dist/tools/handlers/maps.d.ts.map +1 -1
- package/dist/tools/handlers/ontology.d.ts +1 -1
- package/dist/tools/handlers/ontology.d.ts.map +1 -1
- package/dist/tools/handlers/tool-guide.d.ts +1 -1
- package/dist/tools/handlers/tool-guide.d.ts.map +1 -1
- package/dist/tools/handlers.d.ts +15 -3
- package/dist/tools/handlers.d.ts.map +1 -1
- package/dist/tools/handlers.js +71 -31
- package/dist/tools/handlers.js.map +1 -1
- package/dist/tools/lane.d.ts +11 -6
- package/dist/tools/lane.d.ts.map +1 -1
- package/dist/tools/lane.js +46 -9
- package/dist/tools/lane.js.map +1 -1
- package/dist/tools/minimal-descriptions.js +1 -1
- package/dist/tools/minimal-descriptions.js.map +1 -1
- package/dist/tools/p5-compat/p5-helpers.d.ts +1 -1
- package/dist/tools/p5-compat/p5-helpers.js +1 -1
- package/dist/tools/shape-params.d.ts +2 -2
- package/dist/tools/shape-params.d.ts.map +1 -1
- package/dist/tools/shape-params.js +8 -2
- package/dist/tools/shape-params.js.map +1 -1
- package/dist/tools/stick-vocabulary.d.ts +2 -2
- package/dist/tools/stick-vocabulary.js +2 -2
- package/dist/tools/timeline.d.ts +2 -2
- package/dist/tools/timeline.d.ts.map +1 -1
- package/dist/tools/timeline.js +6 -1
- package/dist/tools/timeline.js.map +1 -1
- package/dist/tools/toolkits.d.ts +22 -7
- package/dist/tools/toolkits.d.ts.map +1 -1
- package/dist/tools/toolkits.js +102 -20
- package/dist/tools/toolkits.js.map +1 -1
- package/dist/types/code-generator.d.ts +25 -0
- package/dist/types/code-generator.d.ts.map +1 -1
- package/dist/types/code-generator.js +424 -157
- package/dist/types/code-generator.js.map +1 -1
- package/dist/types/schemas.d.ts +52 -47
- package/dist/types/schemas.d.ts.map +1 -1
- package/dist/types/schemas.js +7 -5
- package/dist/types/schemas.js.map +1 -1
- package/dist/utils/asset-paths.d.ts.map +1 -1
- package/dist/utils/asset-paths.js +4 -4
- package/dist/utils/asset-paths.js.map +1 -1
- package/dist/utils/env.d.ts +9 -0
- package/dist/utils/env.d.ts.map +1 -0
- package/dist/utils/env.js +11 -0
- package/dist/utils/env.js.map +1 -0
- package/dist/utils/export-dir.d.ts +36 -0
- package/dist/utils/export-dir.d.ts.map +1 -0
- package/dist/utils/export-dir.js +86 -0
- package/dist/utils/export-dir.js.map +1 -0
- package/dist/utils/js-literal.d.ts +4 -0
- package/dist/utils/js-literal.d.ts.map +1 -0
- package/dist/utils/js-literal.js +25 -0
- package/dist/utils/js-literal.js.map +1 -0
- package/dist/utils/mcp-log.d.ts +1 -1
- package/dist/utils/mcp-log.d.ts.map +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +5 -12
- package/dist/version.js.map +1 -1
- package/manifest.json +42 -63
- package/package.json +8 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset-paths.d.ts","sourceRoot":"","sources":["../../src/utils/asset-paths.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"asset-paths.d.ts","sourceRoot":"","sources":["../../src/utils/asset-paths.ts"],"names":[],"mappings":"AAyBA,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAK3D;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAkBlG"}
|
|
@@ -15,8 +15,9 @@
|
|
|
15
15
|
* pinepaper_import_image. Refusing that would break the tool's own advice.
|
|
16
16
|
*/
|
|
17
17
|
import { realpath } from 'node:fs/promises';
|
|
18
|
-
import { tmpdir } from 'node:os';
|
|
19
18
|
import { basename, delimiter, dirname, join, resolve, sep } from 'node:path';
|
|
19
|
+
import { env } from './env.js';
|
|
20
|
+
import { getExportDir } from './export-dir.js';
|
|
20
21
|
async function real(p) {
|
|
21
22
|
try {
|
|
22
23
|
return await realpath(p);
|
|
@@ -26,9 +27,8 @@ async function real(p) {
|
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
export async function allowedAssetRoots() {
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
const entries = [process.cwd(), exportDir, ...(process.env.PINEPAPER_ASSET_DIRS ?? '').split(delimiter).filter(Boolean)];
|
|
30
|
+
const exportDir = getExportDir();
|
|
31
|
+
const entries = [process.cwd(), exportDir, ...(env('PINEPAPER_ASSET_DIRS') ?? '').split(delimiter).filter(Boolean)];
|
|
32
32
|
const roots = await Promise.all(entries.map((e) => real(resolve(e))));
|
|
33
33
|
return [...new Set(roots.filter((r) => r !== null))];
|
|
34
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset-paths.js","sourceRoot":"","sources":["../../src/utils/asset-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"asset-paths.js","sourceRoot":"","sources":["../../src/utils/asset-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO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
+
* The one place this server reads its environment (PINEPAPER_*, and the locale
|
|
3
|
+
* variables). Read at call time, never cached, so a value set after start-up is
|
|
4
|
+
* seen. Kept in one module so the package's environment access is one
|
|
5
|
+
* reviewable file rather than one per feature. safe-fetch.ts keeps its own
|
|
6
|
+
* reader: it is bundled on its own and takes no relative imports.
|
|
7
|
+
*/
|
|
8
|
+
export declare function env(name: string): string | undefined;
|
|
9
|
+
//# sourceMappingURL=env.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/utils/env.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEpD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one place this server reads its environment (PINEPAPER_*, and the locale
|
|
3
|
+
* variables). Read at call time, never cached, so a value set after start-up is
|
|
4
|
+
* seen. Kept in one module so the package's environment access is one
|
|
5
|
+
* reviewable file rather than one per feature. safe-fetch.ts keeps its own
|
|
6
|
+
* reader: it is bundled on its own and takes no relative imports.
|
|
7
|
+
*/
|
|
8
|
+
export function env(name) {
|
|
9
|
+
return process.env[name];
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=env.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/utils/env.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,GAAG,CAAC,IAAY;IAC9B,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare function getExportDir(): string;
|
|
2
|
+
export declare function mimeTypeFor(filePath: string): string | undefined;
|
|
3
|
+
/**
|
|
4
|
+
* A saved export as an MCP resource_link: a client can offer it to open or save,
|
|
5
|
+
* where the path in the text was something only a terminal user could act on.
|
|
6
|
+
* The URI is a file:// URL (pathToFileURL: spaces, Windows drives), and
|
|
7
|
+
* resources/read serves it while it is inside the export folder.
|
|
8
|
+
*/
|
|
9
|
+
export declare function exportFileLink(filePath: string, size?: number): {
|
|
10
|
+
size?: number | undefined;
|
|
11
|
+
mimeType?: string | undefined;
|
|
12
|
+
type: "resource_link";
|
|
13
|
+
uri: string;
|
|
14
|
+
name: string;
|
|
15
|
+
};
|
|
16
|
+
/** Largest export resources/read returns inline; above it the reply gives the path (base64 grows it by a third). */
|
|
17
|
+
export declare const EXPORT_READ_MAX_BYTES: number;
|
|
18
|
+
/**
|
|
19
|
+
* resources/read for an export's file:// link. Served only from inside the export folder (real paths, so a
|
|
20
|
+
* symlink out of it is refused), and only up to EXPORT_READ_MAX_BYTES; a bigger file is named, not sent.
|
|
21
|
+
*/
|
|
22
|
+
export declare function readExportFile(uri: string): Promise<{
|
|
23
|
+
ok: true;
|
|
24
|
+
contents: {
|
|
25
|
+
uri: string;
|
|
26
|
+
mimeType?: string;
|
|
27
|
+
text?: string;
|
|
28
|
+
blob?: string;
|
|
29
|
+
};
|
|
30
|
+
} | {
|
|
31
|
+
ok: false;
|
|
32
|
+
reason: string;
|
|
33
|
+
path?: string;
|
|
34
|
+
size?: number;
|
|
35
|
+
}>;
|
|
36
|
+
//# sourceMappingURL=export-dir.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-dir.d.ts","sourceRoot":"","sources":["../../src/utils/export-dir.ts"],"names":[],"mappings":"AAoBA,wBAAgB,YAAY,IAAI,MAAM,CAQrC;AAQD,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEhE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;;;;;;EAS7D;AAED,oHAAoH;AACpH,eAAO,MAAM,qBAAqB,QAAmB,CAAC;AAGtD;;;GAGG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CACxD;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CACvJ,CAgBA"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where exports are saved: PINEPAPER_EXPORT_DIR, else ~/Downloads/PinePaper,
|
|
3
|
+
* else the temp folder.
|
|
4
|
+
*
|
|
5
|
+
* WHY DOWNLOADS (1.6.25): the default was <tmp>/pinepaper-exports. A Claude
|
|
6
|
+
* Desktop user never sees that folder and the model cannot open it for them, so
|
|
7
|
+
* a finished export was a path in a reply and nothing the user could find. A
|
|
8
|
+
* machine without a Downloads folder (a server, CI) keeps the temp folder.
|
|
9
|
+
*
|
|
10
|
+
* ONE function, used by the writers (handlers.ts) and by path confinement
|
|
11
|
+
* (asset-paths.ts): two copies of the default would refuse the server's own
|
|
12
|
+
* exports the day they disagreed.
|
|
13
|
+
*/
|
|
14
|
+
import { existsSync } from 'node:fs';
|
|
15
|
+
import { readFile, realpath, stat } from 'node:fs/promises';
|
|
16
|
+
import { homedir, tmpdir } from 'node:os';
|
|
17
|
+
import { basename, extname, join, sep } from 'node:path';
|
|
18
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
19
|
+
import { env } from './env.js';
|
|
20
|
+
export function getExportDir() {
|
|
21
|
+
const configured = env('PINEPAPER_EXPORT_DIR');
|
|
22
|
+
if (configured)
|
|
23
|
+
return configured;
|
|
24
|
+
try {
|
|
25
|
+
const downloads = join(homedir(), 'Downloads');
|
|
26
|
+
if (existsSync(downloads))
|
|
27
|
+
return join(downloads, 'PinePaper');
|
|
28
|
+
}
|
|
29
|
+
catch { /* no home directory */ }
|
|
30
|
+
return join(tmpdir(), 'pinepaper-exports');
|
|
31
|
+
}
|
|
32
|
+
const MIME = {
|
|
33
|
+
mp4: 'video/mp4', webm: 'video/webm', gif: 'image/gif', png: 'image/png', jpg: 'image/jpeg', jpeg: 'image/jpeg',
|
|
34
|
+
webp: 'image/webp', svg: 'image/svg+xml', pdf: 'application/pdf', wav: 'audio/wav', zip: 'application/zip',
|
|
35
|
+
html: 'text/html', json: 'application/json', srt: 'application/x-subrip', vtt: 'text/vtt', scc: 'text/plain',
|
|
36
|
+
};
|
|
37
|
+
export function mimeTypeFor(filePath) {
|
|
38
|
+
return MIME[extname(filePath).slice(1).toLowerCase()];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A saved export as an MCP resource_link: a client can offer it to open or save,
|
|
42
|
+
* where the path in the text was something only a terminal user could act on.
|
|
43
|
+
* The URI is a file:// URL (pathToFileURL: spaces, Windows drives), and
|
|
44
|
+
* resources/read serves it while it is inside the export folder.
|
|
45
|
+
*/
|
|
46
|
+
export function exportFileLink(filePath, size) {
|
|
47
|
+
const mimeType = mimeTypeFor(filePath);
|
|
48
|
+
return {
|
|
49
|
+
type: 'resource_link',
|
|
50
|
+
uri: pathToFileURL(filePath).href,
|
|
51
|
+
name: basename(filePath),
|
|
52
|
+
...(mimeType ? { mimeType } : {}),
|
|
53
|
+
...(typeof size === 'number' ? { size } : {}),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/** Largest export resources/read returns inline; above it the reply gives the path (base64 grows it by a third). */
|
|
57
|
+
export const EXPORT_READ_MAX_BYTES = 10 * 1024 * 1024;
|
|
58
|
+
const TEXT_EXTENSIONS = new Set(['svg', 'json', 'html', 'srt', 'vtt', 'scc']);
|
|
59
|
+
/**
|
|
60
|
+
* resources/read for an export's file:// link. Served only from inside the export folder (real paths, so a
|
|
61
|
+
* symlink out of it is refused), and only up to EXPORT_READ_MAX_BYTES; a bigger file is named, not sent.
|
|
62
|
+
*/
|
|
63
|
+
export async function readExportFile(uri) {
|
|
64
|
+
let path;
|
|
65
|
+
try {
|
|
66
|
+
path = fileURLToPath(uri);
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
return { ok: false, reason: 'not a file URL' };
|
|
70
|
+
}
|
|
71
|
+
const [file, root] = await Promise.all([realpath(path).catch(() => null), realpath(getExportDir()).catch(() => null)]);
|
|
72
|
+
if (!file)
|
|
73
|
+
return { ok: false, reason: 'no such file', path };
|
|
74
|
+
if (!root || !(file === root || file.startsWith(root.endsWith(sep) ? root : root + sep))) {
|
|
75
|
+
return { ok: false, reason: `only files in the export folder (${getExportDir()}) can be read this way`, path };
|
|
76
|
+
}
|
|
77
|
+
const { size } = await stat(file);
|
|
78
|
+
if (size > EXPORT_READ_MAX_BYTES) {
|
|
79
|
+
return { ok: false, reason: `the file is ${(size / 1048576).toFixed(1)} MB, over the ${EXPORT_READ_MAX_BYTES / 1048576} MB that is sent inline; open it at ${file}`, path: file, size };
|
|
80
|
+
}
|
|
81
|
+
const bytes = await readFile(file);
|
|
82
|
+
const mimeType = mimeTypeFor(file);
|
|
83
|
+
const text = TEXT_EXTENSIONS.has(extname(file).slice(1).toLowerCase());
|
|
84
|
+
return { ok: true, contents: { uri, ...(mimeType ? { mimeType } : {}), ...(text ? { text: bytes.toString('utf8') } : { blob: bytes.toString('base64') }) } };
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=export-dir.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-dir.js","sourceRoot":"","sources":["../../src/utils/export-dir.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACr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AE,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;AAC/J,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function escapeUnsafeChars(json: string): string;
|
|
2
|
+
/** JSON.stringify(value, null, indent) with the unsafe characters escaped; `undefined` for a value JSON has no text for. */
|
|
3
|
+
export declare function jsLiteral(value: unknown, indent?: number): string;
|
|
4
|
+
//# sourceMappingURL=js-literal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js-literal.d.ts","sourceRoot":"","sources":["../../src/utils/js-literal.ts"],"names":[],"mappings":"AAiBA,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,4HAA4H;AAC5H,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAGjE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A value as a JavaScript literal to splice into generated code.
|
|
3
|
+
*
|
|
4
|
+
* JSON.stringify alone is a correct JS literal, but `<`, `>`, U+2028 and U+2029
|
|
5
|
+
* pass through it unescaped: "</script>" inside a string ends a script element
|
|
6
|
+
* the code may be pasted into, and the two separators were line terminators in
|
|
7
|
+
* JS before ES2019. Escaping them changes no value the literal evaluates to,
|
|
8
|
+
* so the code is safe in any of those homes. Code scanning asks for exactly
|
|
9
|
+
* this (js/bad-code-sanitization).
|
|
10
|
+
*/
|
|
11
|
+
const UNSAFE = {
|
|
12
|
+
'<': '\\u003C',
|
|
13
|
+
'>': '\\u003E',
|
|
14
|
+
'\u2028': '\\u2028',
|
|
15
|
+
'\u2029': '\\u2029',
|
|
16
|
+
};
|
|
17
|
+
export function escapeUnsafeChars(json) {
|
|
18
|
+
return json.replace(/[<>\u2028\u2029]/g, (c) => UNSAFE[c]);
|
|
19
|
+
}
|
|
20
|
+
/** JSON.stringify(value, null, indent) with the unsafe characters escaped; `undefined` for a value JSON has no text for. */
|
|
21
|
+
export function jsLiteral(value, indent) {
|
|
22
|
+
const json = JSON.stringify(value, null, indent);
|
|
23
|
+
return json === undefined ? 'undefined' : escapeUnsafeChars(json);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=js-literal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js-literal.js","sourceRoot":"","sources":["../../src/utils/js-literal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,MAAM,GAAqC;IAC/C,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,SAAS;CACpB,CAAC;AAEF,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7D,CAAC;AAED,4HAA4H;AAC5H,MAAM,UAAU,SAAS,CAAC,KAAc,EAAE,MAAe;IACvD,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACjD,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;AACpE,CAAC"}
|
package/dist/utils/mcp-log.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* itself here at start; the SDK applies the client's logging/setLevel filter.
|
|
9
9
|
* With no server registered (tests, CLI), this is a no-op.
|
|
10
10
|
*/
|
|
11
|
-
import type { Server } from '
|
|
11
|
+
import type { Server } from '../mcp/index.js';
|
|
12
12
|
type Level = 'debug' | 'info' | 'notice' | 'warning' | 'error';
|
|
13
13
|
export declare function setLogServer(s: Server | null): void;
|
|
14
14
|
export declare function mcpLog(level: Level, data: string | Record<string, unknown>): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-log.d.ts","sourceRoot":"","sources":["../../src/utils/mcp-log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"mcp-log.d.ts","sourceRoot":"","sources":["../../src/utils/mcp-log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C,KAAK,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;AAI/D,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAEnD;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAGjF"}
|
package/dist/version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAcH,eAAO,MAAM,cAAc,EAAE,MAAoB,CAAC;AAqBlD,eAAO,MAAM,YAAY,EAAE,MAAM,GAAG,IAAkB,CAAC;AAEvD,gFAAgF;AAChF,eAAO,MAAM,yBAAyB,EAAE,MAA4E,CAAC"}
|
package/dist/version.js
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
* Don't hardcode version strings anywhere else.
|
|
9
9
|
*/
|
|
10
10
|
import { readFileSync, existsSync } from 'node:fs';
|
|
11
|
-
import { execFileSync } from 'node:child_process';
|
|
12
11
|
import { fileURLToPath } from 'node:url';
|
|
13
12
|
import { dirname, join } from 'node:path';
|
|
14
13
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
@@ -19,8 +18,10 @@ export const SERVER_VERSION = pkg.version;
|
|
|
19
18
|
/**
|
|
20
19
|
* WHICH BUILD, not which release (tester request, round 9: several builds in
|
|
21
20
|
* a row all reported 1.6.14). A built package reads dist/build-info.json,
|
|
22
|
-
* written at build time
|
|
23
|
-
*
|
|
21
|
+
* written at build time. null when it is absent (running from source) —
|
|
22
|
+
* never a guess. This asked git when running from source until 1.6.25; that
|
|
23
|
+
* put a child_process call in the published package for a path no installed
|
|
24
|
+
* copy ever takes, so the build step is now the only place that asks git.
|
|
24
25
|
*/
|
|
25
26
|
function readBuild() {
|
|
26
27
|
try {
|
|
@@ -32,15 +33,7 @@ function readBuild() {
|
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
35
|
catch { /* fall through */ }
|
|
35
|
-
|
|
36
|
-
const repo = join(here, '..');
|
|
37
|
-
const sha = execFileSync('git', ['-C', repo, 'rev-parse', '--short=7', 'HEAD'], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim();
|
|
38
|
-
const dirty = execFileSync('git', ['-C', repo, 'status', '--porcelain', '--untracked-files=no'], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim() !== '';
|
|
39
|
-
return sha ? sha + (dirty ? '.dirty' : '') : null;
|
|
40
|
-
}
|
|
41
|
-
catch {
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
36
|
+
return null;
|
|
44
37
|
}
|
|
45
38
|
export const SERVER_BUILD = readBuild();
|
|
46
39
|
/** What serverInfo reports: semver with build metadata, e.g. 1.6.14+7b7cdf8. */
|
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACrD,mFAAmF;AACnF,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;AAIjD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAgB,CAAC;AAEtE,MAAM,CAAC,MAAM,cAAc,GAAW,GAAG,CAAC,OAAO,CAAC;AAElD;;;;;;;GAOG;AACH,SAAS,SAAS;IAChB,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QAC3C,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YACrB,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAA6C,CAAC;YAC9F,IAAI,CAAC,CAAC,GAAG;gBAAE,OAAO,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;IAAC,MAAM,CAAC,CAAC,kBAAkB,CAAC,CAAC;IAC9B,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAkB,SAAS,EAAE,CAAC;AAEvD,gFAAgF;AAChF,MAAM,CAAC,MAAM,yBAAyB,GAAW,YAAY,CAAC,CAAC,CAAC,GAAG,cAAc,IAAI,YAAY,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC"}
|
package/manifest.json
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest_version": "0.3",
|
|
3
3
|
"name": "pinepaper-mcp",
|
|
4
|
-
"version": "1.6.
|
|
4
|
+
"version": "1.6.26",
|
|
5
5
|
"display_name": "PinePaper",
|
|
6
6
|
"icon": "icon.png",
|
|
7
7
|
"description": "Create animated graphics with AI using PinePaper Studio",
|
|
8
|
-
"long_description": "PinePaper MCP Server enables Claude to create, animate, and export graphics through PinePaper Studio. Features include shape creation, relation-based animations (orbits, follows, attached_to), procedural generators, visual effects, SVG export with animations,
|
|
8
|
+
"long_description": "PinePaper MCP Server enables Claude to create, animate, and export graphics through PinePaper Studio. Features include shape creation, relation-based animations (orbits, follows, attached_to), procedural generators, visual effects, SVG export with animations, icon search & import from Iconify and Font Awesome, performance metrics tracking, diagram tools for flowcharts/UML/network diagrams with smart connectors and auto-layout, enhanced error messages with canvas context, Agent Flow Mode for content automation pipelines with batch operations and smart platform exports (Instagram, TikTok, YouTube, etc.), interactive triggers (click, hover, drag events), interactive stories and quizzes, Letter Collage for stylized text with per-letter customization (Wordle, magazine cutout, gradient styles and tile palettes), and canvas presets for social media platforms. Supports two execution modes: Puppeteer (live browser execution) and Code (generate code for manual paste).",
|
|
9
9
|
"author": {
|
|
10
10
|
"name": "PinePaper Studio",
|
|
11
|
-
"url": "https://github.com/pinepaper"
|
|
12
|
-
},
|
|
13
|
-
"support": {
|
|
14
11
|
"email": "support@pinepaper.studio",
|
|
15
|
-
"url": "https://github.com/pinepaper
|
|
12
|
+
"url": "https://github.com/pinepaper"
|
|
16
13
|
},
|
|
14
|
+
"support": "https://github.com/pinepaper/mcp-server/issues",
|
|
17
15
|
"repository": {
|
|
18
16
|
"type": "git",
|
|
19
17
|
"url": "https://github.com/pinepaper/mcp-server"
|
|
20
18
|
},
|
|
21
19
|
"homepage": "https://pinepaper.studio",
|
|
22
20
|
"license": "MIT",
|
|
23
|
-
"
|
|
21
|
+
"privacy_policies": [
|
|
22
|
+
"https://pinepaper.studio/privacy-policy"
|
|
23
|
+
],
|
|
24
24
|
"keywords": [
|
|
25
25
|
"animation",
|
|
26
26
|
"graphics",
|
|
@@ -36,65 +36,44 @@
|
|
|
36
36
|
"command": "node",
|
|
37
37
|
"args": [
|
|
38
38
|
"${__dirname}/dist/cli.js"
|
|
39
|
-
]
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
"description": "Execution mode: 'puppeteer' (live browser) or 'code' (generate only)",
|
|
45
|
-
"default": "puppeteer",
|
|
46
|
-
"enum": [
|
|
47
|
-
"puppeteer",
|
|
48
|
-
"code"
|
|
49
|
-
]
|
|
50
|
-
},
|
|
51
|
-
"toolkit": {
|
|
52
|
-
"type": "string",
|
|
53
|
-
"description": "Tool visibility profile controlling which tools are exposed",
|
|
54
|
-
"default": "agent",
|
|
55
|
-
"enum": [
|
|
56
|
-
"full",
|
|
57
|
-
"agent",
|
|
58
|
-
"diagram",
|
|
59
|
-
"map",
|
|
60
|
-
"font",
|
|
61
|
-
"minimal"
|
|
62
|
-
]
|
|
63
|
-
},
|
|
64
|
-
"verbosity": {
|
|
65
|
-
"type": "string",
|
|
66
|
-
"description": "Tool description detail level. 'minimal' uses 1-line summaries with on-demand guide tool",
|
|
67
|
-
"default": "compact",
|
|
68
|
-
"enum": [
|
|
69
|
-
"verbose",
|
|
70
|
-
"compact",
|
|
71
|
-
"minimal"
|
|
72
|
-
]
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
"env": {
|
|
76
|
-
"PINEPAPER_EXECUTION_MODE": {
|
|
77
|
-
"description": "Set default execution mode ('puppeteer' or 'code')",
|
|
78
|
-
"default": "puppeteer"
|
|
79
|
-
},
|
|
80
|
-
"PINEPAPER_TOOLKIT": {
|
|
81
|
-
"description": "Tool visibility profile: 'full', 'agent', 'diagram', 'map', 'font', 'minimal'",
|
|
82
|
-
"default": "agent"
|
|
83
|
-
},
|
|
84
|
-
"PINEPAPER_VERBOSITY": {
|
|
85
|
-
"description": "Tool description detail: 'verbose', 'compact', 'minimal'",
|
|
86
|
-
"default": "compact"
|
|
87
|
-
},
|
|
88
|
-
"PINEPAPER_SCREENSHOT_MODE": {
|
|
89
|
-
"description": "Screenshot behavior ('on_request', 'always', 'never')",
|
|
90
|
-
"default": "on_request"
|
|
91
|
-
},
|
|
92
|
-
"PINEPAPER_LOCALE": {
|
|
93
|
-
"description": "UI locale (e.g., 'en', 'ja', 'zh-CN')",
|
|
94
|
-
"default": "en"
|
|
39
|
+
],
|
|
40
|
+
"env": {
|
|
41
|
+
"PINEPAPER_CHROME_PATH": "${user_config.chrome_path}",
|
|
42
|
+
"PINEPAPER_EXPORT_DIR": "${user_config.export_dir}",
|
|
43
|
+
"PINEPAPER_TOOLKIT": "${user_config.toolkit}"
|
|
95
44
|
}
|
|
96
45
|
}
|
|
97
46
|
},
|
|
47
|
+
"user_config": {
|
|
48
|
+
"chrome_path": {
|
|
49
|
+
"type": "file",
|
|
50
|
+
"title": "Browser for the canvas",
|
|
51
|
+
"description": "Optional. The canvas tools drive Google Chrome. To use another Chromium-based browser (Edge, Brave, Chromium), choose its program here.",
|
|
52
|
+
"required": false
|
|
53
|
+
},
|
|
54
|
+
"export_dir": {
|
|
55
|
+
"type": "directory",
|
|
56
|
+
"title": "Export folder",
|
|
57
|
+
"description": "Optional. Where exports are saved. Empty means Downloads/PinePaper.",
|
|
58
|
+
"required": false
|
|
59
|
+
},
|
|
60
|
+
"toolkit": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"title": "Tool list",
|
|
63
|
+
"description": "Optional. Empty or \"core\" starts with the core tools and loads more on demand; \"agent\" or \"full\" lists everything up front (much more context).",
|
|
64
|
+
"required": false
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"compatibility": {
|
|
68
|
+
"platforms": [
|
|
69
|
+
"darwin",
|
|
70
|
+
"win32",
|
|
71
|
+
"linux"
|
|
72
|
+
],
|
|
73
|
+
"runtimes": {
|
|
74
|
+
"node": ">=18.0.0"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
98
77
|
"tools": [
|
|
99
78
|
{
|
|
100
79
|
"name": "pinepaper_set_background_color",
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pinepaper.studio/mcp-server",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.26",
|
|
4
4
|
"mcpName": "io.github.pinepaper/mcp-server",
|
|
5
5
|
"description": "MCP Server for PinePaper Studio - Create animated graphics with AI",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
9
|
"bin": {
|
|
10
|
-
"pinepaper-mcp": "
|
|
10
|
+
"pinepaper-mcp": "dist/cli.js"
|
|
11
11
|
},
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"typecheck": "tsc --noEmit",
|
|
39
39
|
"check:manifest": "bun scripts/check-manifest-tools.mjs",
|
|
40
40
|
"fix:manifest": "bun scripts/check-manifest-tools.mjs --fix",
|
|
41
|
-
"prepublishOnly": "bun run check:manifest && bun run check:design && bun run check:character && bun run check:engine-methods && bun run check:engine-surface && bun run check:shape-params && bun run check:stick-vocabulary && bun run check:ontology-vocabulary && bun run check:engine-lists && bun run check:relation-names && bun run build",
|
|
41
|
+
"prepublishOnly": "bun run check:manifest && bun run check:design && bun run check:character && bun run check:engine-methods && bun run check:engine-surface && bun run check:shape-params && bun run check:stick-vocabulary && bun run check:ontology-vocabulary && bun run check:engine-lists && bun run check:relation-names && bun run build && node scripts/check-dist-no-sdk.mjs",
|
|
42
42
|
"lint:errors": "eslint src --quiet",
|
|
43
43
|
"sync:design": "node scripts/sync-design-systems.mjs",
|
|
44
44
|
"check:design": "node scripts/sync-design-systems.mjs --check",
|
|
@@ -61,7 +61,8 @@
|
|
|
61
61
|
"sync:engine-lists": "node scripts/sync-engine-lists.mjs",
|
|
62
62
|
"fix:engine-lists": "node scripts/sync-engine-lists.mjs",
|
|
63
63
|
"check:engine-lists": "node scripts/sync-engine-lists.mjs --check",
|
|
64
|
-
"check:relation-names": "node scripts/check-relation-names.mjs"
|
|
64
|
+
"check:relation-names": "node scripts/check-relation-names.mjs",
|
|
65
|
+
"build:mcpb": "bun run build && node scripts/build-mcpb.mjs"
|
|
65
66
|
},
|
|
66
67
|
"keywords": [
|
|
67
68
|
"mcp",
|
|
@@ -77,17 +78,17 @@
|
|
|
77
78
|
"license": "MIT",
|
|
78
79
|
"repository": {
|
|
79
80
|
"type": "git",
|
|
80
|
-
"url": "https://github.com/pinepaper/mcp-server"
|
|
81
|
+
"url": "git+https://github.com/pinepaper/mcp-server.git"
|
|
81
82
|
},
|
|
82
83
|
"engines": {
|
|
83
84
|
"node": ">=18.0.0"
|
|
84
85
|
},
|
|
85
86
|
"dependencies": {
|
|
86
|
-
"@modelcontextprotocol/sdk": "^1.32.1",
|
|
87
87
|
"undici": "^6",
|
|
88
88
|
"zod": "^4.6.7"
|
|
89
89
|
},
|
|
90
90
|
"devDependencies": {
|
|
91
|
+
"@modelcontextprotocol/sdk": "^1.32.1",
|
|
91
92
|
"@types/bun": "latest",
|
|
92
93
|
"@types/node": "^20.10.0",
|
|
93
94
|
"@typescript-eslint/eslint-plugin": "^8.66.0",
|
|
@@ -127,6 +128,7 @@
|
|
|
127
128
|
"hasown": "npm:@socketregistry/hasown@^1.0.7",
|
|
128
129
|
"ip-address": "^10.7.4",
|
|
129
130
|
"js-yaml": "^4.3.1",
|
|
131
|
+
"minimatch": "^11.0.3",
|
|
130
132
|
"object-assign": "npm:@socketregistry/object-assign@^1.0.5",
|
|
131
133
|
"path-to-regexp": "^8.4.2",
|
|
132
134
|
"proxy-addr": "^2.0.8",
|
|
@@ -135,13 +137,5 @@
|
|
|
135
137
|
"side-channel": "npm:@socketregistry/side-channel@^1.0.10",
|
|
136
138
|
"ws": "^8.21.1",
|
|
137
139
|
"hono": "^4.13.13"
|
|
138
|
-
},
|
|
139
|
-
"peerDependencies": {
|
|
140
|
-
"puppeteer": ">=22"
|
|
141
|
-
},
|
|
142
|
-
"peerDependenciesMeta": {
|
|
143
|
-
"puppeteer": {
|
|
144
|
-
"optional": true
|
|
145
|
-
}
|
|
146
140
|
}
|
|
147
141
|
}
|