@bendyline/docblocks-cli 2.0.0 → 2.1.1
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 +11 -17
- package/dist/bin.d.ts +1 -0
- package/dist/bin.js +7463 -0
- package/dist/index.d.ts +133 -2
- package/dist/index.js +1328 -27
- package/package.json +23 -10
- package/dist/commands/build.d.ts +0 -14
- package/dist/commands/build.d.ts.map +0 -1
- package/dist/commands/build.js +0 -74
- package/dist/commands/build.js.map +0 -1
- package/dist/commands/convert.d.ts +0 -42
- package/dist/commands/convert.d.ts.map +0 -1
- package/dist/commands/convert.js +0 -339
- package/dist/commands/convert.js.map +0 -1
- package/dist/commands/init.d.ts +0 -3
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -23
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/mcp.d.ts +0 -12
- package/dist/commands/mcp.d.ts.map +0 -1
- package/dist/commands/mcp.js +0 -106
- package/dist/commands/mcp.js.map +0 -1
- package/dist/commands/parse.d.ts +0 -6
- package/dist/commands/parse.d.ts.map +0 -1
- package/dist/commands/parse.js +0 -38
- package/dist/commands/parse.js.map +0 -1
- package/dist/commands/serve.d.ts +0 -36
- package/dist/commands/serve.d.ts.map +0 -1
- package/dist/commands/serve.js +0 -347
- package/dist/commands/serve.js.map +0 -1
- package/dist/commands/themes.d.ts +0 -6
- package/dist/commands/themes.d.ts.map +0 -1
- package/dist/commands/themes.js +0 -15
- package/dist/commands/themes.js.map +0 -1
- package/dist/commands/transforms.d.ts +0 -6
- package/dist/commands/transforms.d.ts.map +0 -1
- package/dist/commands/transforms.js +0 -15
- package/dist/commands/transforms.js.map +0 -1
- package/dist/commands/video.d.ts +0 -38
- package/dist/commands/video.d.ts.map +0 -1
- package/dist/commands/video.js +0 -136
- package/dist/commands/video.js.map +0 -1
- package/dist/contained-file.d.ts +0 -8
- package/dist/contained-file.d.ts.map +0 -1
- package/dist/contained-file.js +0 -77
- package/dist/contained-file.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/mcp/agentic-tools.d.ts +0 -16
- package/dist/mcp/agentic-tools.d.ts.map +0 -1
- package/dist/mcp/agentic-tools.js +0 -967
- package/dist/mcp/agentic-tools.js.map +0 -1
- package/dist/mcp/artifact-store.d.ts +0 -98
- package/dist/mcp/artifact-store.d.ts.map +0 -1
- package/dist/mcp/artifact-store.js +0 -542
- package/dist/mcp/artifact-store.js.map +0 -1
- package/dist/mcp/authority.d.ts +0 -53
- package/dist/mcp/authority.d.ts.map +0 -1
- package/dist/mcp/authority.js +0 -433
- package/dist/mcp/authority.js.map +0 -1
- package/dist/mcp/conversion-service.d.ts +0 -111
- package/dist/mcp/conversion-service.d.ts.map +0 -1
- package/dist/mcp/conversion-service.js +0 -512
- package/dist/mcp/conversion-service.js.map +0 -1
- package/dist/mcp/discovery-tools.d.ts +0 -4
- package/dist/mcp/discovery-tools.d.ts.map +0 -1
- package/dist/mcp/discovery-tools.js +0 -114
- package/dist/mcp/discovery-tools.js.map +0 -1
- package/dist/mcp/document-service.d.ts +0 -47
- package/dist/mcp/document-service.d.ts.map +0 -1
- package/dist/mcp/document-service.js +0 -424
- package/dist/mcp/document-service.js.map +0 -1
- package/dist/mcp/error-result.d.ts +0 -17
- package/dist/mcp/error-result.d.ts.map +0 -1
- package/dist/mcp/error-result.js +0 -82
- package/dist/mcp/error-result.js.map +0 -1
- package/dist/mcp/intelligence.d.ts +0 -15
- package/dist/mcp/intelligence.d.ts.map +0 -1
- package/dist/mcp/intelligence.js +0 -855
- package/dist/mcp/intelligence.js.map +0 -1
- package/dist/mcp/output-bounds.d.ts +0 -13
- package/dist/mcp/output-bounds.d.ts.map +0 -1
- package/dist/mcp/output-bounds.js +0 -61
- package/dist/mcp/output-bounds.js.map +0 -1
- package/dist/mcp/preview-service.d.ts +0 -54
- package/dist/mcp/preview-service.d.ts.map +0 -1
- package/dist/mcp/preview-service.js +0 -454
- package/dist/mcp/preview-service.js.map +0 -1
- package/dist/mcp/progress.d.ts +0 -18
- package/dist/mcp/progress.d.ts.map +0 -1
- package/dist/mcp/progress.js +0 -28
- package/dist/mcp/progress.js.map +0 -1
- package/dist/mcp/prompts.d.ts +0 -4
- package/dist/mcp/prompts.d.ts.map +0 -1
- package/dist/mcp/prompts.js +0 -124
- package/dist/mcp/prompts.js.map +0 -1
- package/dist/mcp/rendered-conversion.d.ts +0 -34
- package/dist/mcp/rendered-conversion.d.ts.map +0 -1
- package/dist/mcp/rendered-conversion.js +0 -364
- package/dist/mcp/rendered-conversion.js.map +0 -1
- package/dist/mcp/server.d.ts +0 -69
- package/dist/mcp/server.d.ts.map +0 -1
- package/dist/mcp/server.js +0 -249
- package/dist/mcp/server.js.map +0 -1
- package/dist/preview-policy.d.ts +0 -8
- package/dist/preview-policy.d.ts.map +0 -1
- package/dist/preview-policy.js +0 -85
- package/dist/preview-policy.js.map +0 -1
- package/dist/render-html.d.ts +0 -17
- package/dist/render-html.d.ts.map +0 -1
- package/dist/render-html.js +0 -85
- package/dist/render-html.js.map +0 -1
- package/dist/version.d.ts +0 -6
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js +0 -104
- package/dist/version.js.map +0 -1
package/dist/commands/video.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* video command
|
|
3
|
-
*
|
|
4
|
-
* Renders a squisq document to MP4 video using Playwright + FFmpeg.
|
|
5
|
-
* Wraps the squisq-cli's renderDocToMp4 programmatic API.
|
|
6
|
-
*/
|
|
7
|
-
import { Command } from 'commander';
|
|
8
|
-
import type { VideoQuality, VideoOrientation } from '@bendyline/squisq-video';
|
|
9
|
-
declare const VALID_CAPTIONS: readonly ["off", "standard", "social"];
|
|
10
|
-
type CaptionOption = (typeof VALID_CAPTIONS)[number];
|
|
11
|
-
export interface VideoOptions {
|
|
12
|
-
output?: string;
|
|
13
|
-
fps?: number;
|
|
14
|
-
quality?: VideoQuality;
|
|
15
|
-
orientation?: VideoOrientation;
|
|
16
|
-
captions?: CaptionOption;
|
|
17
|
-
width?: number;
|
|
18
|
-
height?: number;
|
|
19
|
-
/** Cancel input preparation, browser capture, or FFmpeg encoding. */
|
|
20
|
-
signal?: AbortSignal;
|
|
21
|
-
}
|
|
22
|
-
export interface VideoResult {
|
|
23
|
-
outputPath: string;
|
|
24
|
-
duration: number;
|
|
25
|
-
frameCount: number;
|
|
26
|
-
}
|
|
27
|
-
type RenderDocToMp4 = typeof import('@bendyline/squisq-cli/api').renderDocToMp4;
|
|
28
|
-
export interface VideoRunDependencies {
|
|
29
|
-
/** Test/programmatic override; production uses the linked Squisq renderer. */
|
|
30
|
-
renderDocToMp4?: RenderDocToMp4;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Core video rendering logic — reusable by both CLI and MCP tools.
|
|
34
|
-
*/
|
|
35
|
-
export declare function runVideo(inputPath: string, opts: VideoOptions, onProgress?: (phase: string, percent: number) => void, dependencies?: VideoRunDependencies): Promise<VideoResult>;
|
|
36
|
-
export declare const videoCommand: Command;
|
|
37
|
-
export {};
|
|
38
|
-
//# sourceMappingURL=video.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../../src/commands/video.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAI9E,QAAA,MAAM,cAAc,wCAAyC,CAAC;AAE9D,KAAK,aAAa,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,KAAK,cAAc,GAAG,cAAc,2BAA2B,EAAE,cAAc,CAAC;AAEhF,MAAM,WAAW,oBAAoB;IACnC,8EAA8E;IAC9E,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAED;;GAEG;AACH,wBAAsB,QAAQ,CAC5B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,YAAY,EAClB,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,EACrD,YAAY,GAAE,oBAAyB,GACtC,OAAO,CAAC,WAAW,CAAC,CAsFtB;AAoBD,eAAO,MAAM,YAAY,SAkCrB,CAAC"}
|
package/dist/commands/video.js
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* video command
|
|
3
|
-
*
|
|
4
|
-
* Renders a squisq document to MP4 video using Playwright + FFmpeg.
|
|
5
|
-
* Wraps the squisq-cli's renderDocToMp4 programmatic API.
|
|
6
|
-
*/
|
|
7
|
-
import { mkdir } from 'node:fs/promises';
|
|
8
|
-
import { dirname, basename, extname, resolve } from 'node:path';
|
|
9
|
-
import { Command } from 'commander';
|
|
10
|
-
const VALID_QUALITIES = ['draft', 'normal', 'high'];
|
|
11
|
-
const VALID_ORIENTATIONS = ['landscape', 'portrait'];
|
|
12
|
-
const VALID_CAPTIONS = ['off', 'standard', 'social'];
|
|
13
|
-
/**
|
|
14
|
-
* Core video rendering logic — reusable by both CLI and MCP tools.
|
|
15
|
-
*/
|
|
16
|
-
export async function runVideo(inputPath, opts, onProgress, dependencies = {}) {
|
|
17
|
-
throwIfAborted(opts.signal);
|
|
18
|
-
const resolvedInput = resolve(inputPath);
|
|
19
|
-
const fps = opts.fps ?? 30;
|
|
20
|
-
if (!Number.isFinite(fps) || fps < 1 || fps > 120) {
|
|
21
|
-
throw new Error('FPS must be a number between 1 and 120');
|
|
22
|
-
}
|
|
23
|
-
const quality = opts.quality ?? 'normal';
|
|
24
|
-
if (!VALID_QUALITIES.includes(quality)) {
|
|
25
|
-
throw new Error(`Invalid quality "${quality}". Valid: ${VALID_QUALITIES.join(', ')}`);
|
|
26
|
-
}
|
|
27
|
-
const orientation = opts.orientation ?? 'landscape';
|
|
28
|
-
if (!VALID_ORIENTATIONS.includes(orientation)) {
|
|
29
|
-
throw new Error(`Invalid orientation "${orientation}". Valid: ${VALID_ORIENTATIONS.join(', ')}`);
|
|
30
|
-
}
|
|
31
|
-
const captions = opts.captions ?? 'off';
|
|
32
|
-
if (!VALID_CAPTIONS.includes(captions)) {
|
|
33
|
-
throw new Error(`Invalid captions "${captions}". Valid: ${VALID_CAPTIONS.join(', ')}`);
|
|
34
|
-
}
|
|
35
|
-
const captionStyle = captions === 'off' ? undefined : captions;
|
|
36
|
-
// Determine output path
|
|
37
|
-
const inputBasename = basename(resolvedInput);
|
|
38
|
-
const inputExt = extname(inputBasename);
|
|
39
|
-
const baseName = inputExt ? inputBasename.slice(0, -inputExt.length) : inputBasename;
|
|
40
|
-
const outputPath = opts.output
|
|
41
|
-
? resolve(opts.output)
|
|
42
|
-
: resolve(dirname(resolvedInput), `${baseName}.mp4`);
|
|
43
|
-
await mkdir(dirname(outputPath), { recursive: true });
|
|
44
|
-
throwIfAborted(opts.signal);
|
|
45
|
-
console.error(`Reading: ${resolvedInput}`);
|
|
46
|
-
const squisq = await import('@bendyline/squisq-cli/api');
|
|
47
|
-
throwIfAborted(opts.signal);
|
|
48
|
-
const renderDocToMp4 = dependencies.renderDocToMp4 ?? squisq.renderDocToMp4;
|
|
49
|
-
const { readInput } = squisq;
|
|
50
|
-
const result = await readInput(resolvedInput, { signal: opts.signal });
|
|
51
|
-
throwIfAborted(opts.signal);
|
|
52
|
-
const { container, doc } = result;
|
|
53
|
-
console.error(`Using normalized ${result.sourceFormat} document`);
|
|
54
|
-
console.error(`Rendering: ${fps} fps, quality: ${quality}, orientation: ${orientation}, captions: ${captions}`);
|
|
55
|
-
let latestProgress = 0;
|
|
56
|
-
const renderResult = await renderDocToMp4(doc, container, {
|
|
57
|
-
signal: opts.signal,
|
|
58
|
-
outputPath,
|
|
59
|
-
fps,
|
|
60
|
-
quality,
|
|
61
|
-
orientation,
|
|
62
|
-
width: opts.width,
|
|
63
|
-
height: opts.height,
|
|
64
|
-
captionStyle,
|
|
65
|
-
onProgress: (phase, percent) => {
|
|
66
|
-
throwIfAborted(opts.signal);
|
|
67
|
-
const boundedPercent = Math.max(0, Math.min(100, percent));
|
|
68
|
-
if (boundedPercent < latestProgress)
|
|
69
|
-
return;
|
|
70
|
-
latestProgress = boundedPercent;
|
|
71
|
-
if (onProgress)
|
|
72
|
-
onProgress(phase, boundedPercent);
|
|
73
|
-
else
|
|
74
|
-
process.stderr.write(`\r ${phase}: ${boundedPercent}% `);
|
|
75
|
-
throwIfAborted(opts.signal);
|
|
76
|
-
},
|
|
77
|
-
});
|
|
78
|
-
throwIfAborted(opts.signal);
|
|
79
|
-
process.stderr.write('\r' + ' '.repeat(60) + '\r');
|
|
80
|
-
console.error(` ✓ ${outputPath}`);
|
|
81
|
-
console.error(` Duration: ${renderResult.duration.toFixed(1)}s, ${renderResult.frameCount} frames`);
|
|
82
|
-
console.error('Done.');
|
|
83
|
-
return {
|
|
84
|
-
outputPath: renderResult.outputPath,
|
|
85
|
-
duration: renderResult.duration,
|
|
86
|
-
frameCount: renderResult.frameCount,
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
function throwIfAborted(signal) {
|
|
90
|
-
if (!signal?.aborted)
|
|
91
|
-
return;
|
|
92
|
-
if (signal.reason !== undefined)
|
|
93
|
-
throw signal.reason;
|
|
94
|
-
const error = new Error('Video rendering was cancelled');
|
|
95
|
-
error.name = 'AbortError';
|
|
96
|
-
throw error;
|
|
97
|
-
}
|
|
98
|
-
export const videoCommand = new Command('video')
|
|
99
|
-
.description('Render a squisq document to MP4 video')
|
|
100
|
-
.argument('<input>', 'Path to a supported document, .zip/.dbk container, or folder')
|
|
101
|
-
.argument('[output]', 'Output MP4 path (default: <input>.mp4)')
|
|
102
|
-
.option('-o, --output <path>', 'Output MP4 path (default: <input>.mp4)')
|
|
103
|
-
.option('--fps <number>', 'Frames per second', '30')
|
|
104
|
-
.option('--quality <level>', `Encoding quality: ${VALID_QUALITIES.join(', ')}`, 'normal')
|
|
105
|
-
.option('--orientation <orient>', `Video orientation: ${VALID_ORIENTATIONS.join(', ')}`, 'landscape')
|
|
106
|
-
.option('--captions <style>', `Caption style: ${VALID_CAPTIONS.join(', ')}`, 'off')
|
|
107
|
-
.option('--width <pixels>', 'Override video width')
|
|
108
|
-
.option('--height <pixels>', 'Override video height')
|
|
109
|
-
.action(async (inputPath, outputArg, opts) => {
|
|
110
|
-
try {
|
|
111
|
-
if (outputArg && !opts.output) {
|
|
112
|
-
opts.output = outputArg;
|
|
113
|
-
}
|
|
114
|
-
await runVideo(inputPath, {
|
|
115
|
-
output: opts.output,
|
|
116
|
-
fps: parseNumberOption('--fps', opts.fps ?? '30'),
|
|
117
|
-
quality: opts.quality,
|
|
118
|
-
orientation: opts.orientation,
|
|
119
|
-
captions: opts.captions,
|
|
120
|
-
width: opts.width ? parseNumberOption('--width', opts.width) : undefined,
|
|
121
|
-
height: opts.height ? parseNumberOption('--height', opts.height) : undefined,
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
catch (err) {
|
|
125
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
126
|
-
console.error(`Error: ${message}`);
|
|
127
|
-
process.exitCode = 1;
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
function parseNumberOption(name, value) {
|
|
131
|
-
const parsed = Number(value);
|
|
132
|
-
if (!Number.isFinite(parsed))
|
|
133
|
-
throw new Error(`${name} must be a finite number`);
|
|
134
|
-
return parsed;
|
|
135
|
-
}
|
|
136
|
-
//# sourceMappingURL=video.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"video.js","sourceRoot":"","sources":["../../src/commands/video.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAU,CAAC;AAC7D,MAAM,kBAAkB,GAAG,CAAC,WAAW,EAAE,UAAU,CAAU,CAAC;AAC9D,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,CAAU,CAAC;AA6B9D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,SAAiB,EACjB,IAAkB,EAClB,UAAqD,EACrD,eAAqC,EAAE;IAEvC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5B,MAAM,aAAa,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAEzC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC;IAC3B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,GAAG,EAAE,CAAC;QAClD,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,QAAQ,CAAC;IAC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AK,CAAC,CAAC,CAAC,iBAAiB,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;YACxE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS;SAC7E,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjE,OAAO,CAAC,KAAK,CAAC,UAAU,OAAO,EAAE,CAAC,CAAC;QACnC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,SAAS,iBAAiB,CAAC,IAAY,EAAE,KAAa;IACpD,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,0BAA0B,CAAC,CAAC;IACjF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/contained-file.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export interface ContainedFileReadOptions {
|
|
2
|
-
signal?: AbortSignal;
|
|
3
|
-
/** Test seam after each bounded read chunk, before cancellation is rechecked. */
|
|
4
|
-
afterReadChunk?(readBytes: number, totalBytes: number): Promise<void> | void;
|
|
5
|
-
}
|
|
6
|
-
/** Read one regular file only after physical containment and descriptor identity checks. */
|
|
7
|
-
export declare function readContainedFile(rootPath: string, candidatePath: string, maximumBytes: number, options?: ContainedFileReadOptions): Promise<Buffer>;
|
|
8
|
-
//# sourceMappingURL=contained-file.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contained-file.d.ts","sourceRoot":"","sources":["../src/contained-file.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,wBAAwB;IACvC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,iFAAiF;IACjF,cAAc,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CAC9E;AAED,4FAA4F;AAC5F,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,MAAM,CAAC,CAwDjB"}
|
package/dist/contained-file.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs/promises';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
const CONTAINED_READ_CHUNK_BYTES = 64 * 1024;
|
|
4
|
-
/** Read one regular file only after physical containment and descriptor identity checks. */
|
|
5
|
-
export async function readContainedFile(rootPath, candidatePath, maximumBytes, options = {}) {
|
|
6
|
-
const { signal, afterReadChunk } = options;
|
|
7
|
-
signal?.throwIfAborted();
|
|
8
|
-
const physicalRoot = await fs.realpath(path.resolve(rootPath));
|
|
9
|
-
signal?.throwIfAborted();
|
|
10
|
-
const physicalCandidate = await fs.realpath(path.resolve(candidatePath));
|
|
11
|
-
signal?.throwIfAborted();
|
|
12
|
-
if (!isPathInside(physicalRoot, physicalCandidate)) {
|
|
13
|
-
throw new Error('File is outside the authorized root');
|
|
14
|
-
}
|
|
15
|
-
const handle = await fs.open(physicalCandidate, 'r');
|
|
16
|
-
try {
|
|
17
|
-
signal?.throwIfAborted();
|
|
18
|
-
const before = await handle.stat();
|
|
19
|
-
signal?.throwIfAborted();
|
|
20
|
-
if (!before.isFile() || before.size > maximumBytes) {
|
|
21
|
-
throw new Error('File exceeds the configured size limit');
|
|
22
|
-
}
|
|
23
|
-
await assertIdentity(physicalRoot, physicalCandidate, before, signal);
|
|
24
|
-
signal?.throwIfAborted();
|
|
25
|
-
const result = Buffer.alloc(before.size);
|
|
26
|
-
let offset = 0;
|
|
27
|
-
while (offset < result.length) {
|
|
28
|
-
signal?.throwIfAborted();
|
|
29
|
-
const length = Math.min(CONTAINED_READ_CHUNK_BYTES, result.length - offset);
|
|
30
|
-
const { bytesRead } = await handle.read(result, offset, length, offset);
|
|
31
|
-
if (bytesRead === 0)
|
|
32
|
-
break;
|
|
33
|
-
offset += bytesRead;
|
|
34
|
-
await afterReadChunk?.(offset, result.length);
|
|
35
|
-
signal?.throwIfAborted();
|
|
36
|
-
}
|
|
37
|
-
signal?.throwIfAborted();
|
|
38
|
-
const extra = Buffer.alloc(1);
|
|
39
|
-
if ((await handle.read(extra, 0, 1, offset)).bytesRead > 0) {
|
|
40
|
-
throw new Error('File grew beyond the configured size limit');
|
|
41
|
-
}
|
|
42
|
-
signal?.throwIfAborted();
|
|
43
|
-
const after = await handle.stat();
|
|
44
|
-
signal?.throwIfAborted();
|
|
45
|
-
if (before.dev !== after.dev ||
|
|
46
|
-
before.ino !== after.ino ||
|
|
47
|
-
before.size !== after.size ||
|
|
48
|
-
before.mtimeMs !== after.mtimeMs) {
|
|
49
|
-
throw new Error('File changed while it was being read');
|
|
50
|
-
}
|
|
51
|
-
await assertIdentity(physicalRoot, physicalCandidate, after, signal);
|
|
52
|
-
signal?.throwIfAborted();
|
|
53
|
-
return result.subarray(0, offset);
|
|
54
|
-
}
|
|
55
|
-
finally {
|
|
56
|
-
await handle.close();
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
async function assertIdentity(physicalRoot, candidatePath, descriptorStat, signal) {
|
|
60
|
-
signal?.throwIfAborted();
|
|
61
|
-
const physicalCandidate = await fs.realpath(candidatePath);
|
|
62
|
-
signal?.throwIfAborted();
|
|
63
|
-
if (!isPathInside(physicalRoot, physicalCandidate)) {
|
|
64
|
-
throw new Error('File escaped the authorized root while it was being read');
|
|
65
|
-
}
|
|
66
|
-
const pathStat = await fs.stat(physicalCandidate);
|
|
67
|
-
signal?.throwIfAborted();
|
|
68
|
-
if (descriptorStat.dev !== pathStat.dev || descriptorStat.ino !== pathStat.ino) {
|
|
69
|
-
throw new Error('File changed physical identity while it was being read');
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
function isPathInside(rootAbs, candidateAbs) {
|
|
73
|
-
const relative = path.relative(path.resolve(rootAbs), path.resolve(candidateAbs));
|
|
74
|
-
return (relative === '' ||
|
|
75
|
-
(!relative.startsWith(`..${path.sep}`) && relative !== '..' && !path.isAbsolute(relative)));
|
|
76
|
-
}
|
|
77
|
-
//# sourceMappingURL=contained-file.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contained-file.js","sourceRoot":"","sources":["../src/contained-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,0BAA0B,GAAG,EAAE,GAAG,IAAI,CAAC;AAQ7C,4FAA4F;AAC5F,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,QAAgB,EAChB,aAAqB,EACrB,YAAoB,EACpB,UAAoC,EAAE;IAEtC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC;IAC3C,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,MAAM,YAAY,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC/D,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,MAAM,iBAAiB,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;IACzE,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,iBAAiB,CAAC,EAAE,CA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,EAAE,CAAC;QACnD,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;IAC9E,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAClD,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,IAAI,cAAc,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,IAAI,cAAc,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,EAAE,CAAC;QAC/E,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CAAC,OAAe,EAAE,YAAoB;IACzD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;IAClF,OAAO,CACL,QAAQ,KAAK,EAAE;QACf,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,QAAQ,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAC3F,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,WAAW,CAAC;KACjB,WAAW,CAAC,kEAAkE,CAAC;KAC/E,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAC;AAEhC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAChC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AACjC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AACjC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AACnC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AACjC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AAC/B,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;AACtC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AAEjC,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import { ArtifactStore } from './artifact-store.js';
|
|
3
|
-
import { McpFileAuthority } from './authority.js';
|
|
4
|
-
import { MCP_FORMAT_CAPABILITIES } from './conversion-service.js';
|
|
5
|
-
import { type VideoThumbnailExtractor } from './preview-service.js';
|
|
6
|
-
export interface AgenticToolContext {
|
|
7
|
-
authority: Promise<McpFileAuthority>;
|
|
8
|
-
artifacts: ArtifactStore;
|
|
9
|
-
extractVideoThumbnail?: VideoThumbnailExtractor;
|
|
10
|
-
runOperation<T>(signal: AbortSignal, work: (operationSignal: AbortSignal) => Promise<T>): Promise<T>;
|
|
11
|
-
}
|
|
12
|
-
/** Exact target ids accepted by convert_document's runtime input schema. */
|
|
13
|
-
export declare const MCP_CONVERSION_TARGET_FORMATS: readonly ("docx" | "pptx" | "pdf" | "html" | "dbk" | "md" | "xlsx" | "csv" | "htmlzip" | "epub" | "mp4" | "gif")[];
|
|
14
|
-
export declare function registerAgenticTools(server: McpServer, context: AgenticToolContext): void;
|
|
15
|
-
export { MCP_FORMAT_CAPABILITIES };
|
|
16
|
-
//# sourceMappingURL=agentic-tools.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agentic-tools.d.ts","sourceRoot":"","sources":["../../src/mcp/agentic-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAe3F,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EACL,uBAAuB,EAIxB,MAAM,yBAAyB,CAAC;AAejC,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,sBAAsB,CAAC;AAsC9B,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACrC,SAAS,EAAE,aAAa,CAAC;IACzB,qBAAqB,CAAC,EAAE,uBAAuB,CAAC;IAChD,YAAY,CAAC,CAAC,EACZ,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,CAAC,eAAe,EAAE,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,GACjD,OAAO,CAAC,CAAC,CAAC,CAAC;CACf;AAkID,4EAA4E;AAC5E,eAAO,MAAM,6BAA6B,oHAEzC,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAoVzF;AAssBD,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
|