@nowline/cli 0.5.0 → 0.6.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/dist/cli/args.d.ts +17 -3
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +16 -1
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +42 -2
- package/dist/cli/help.js.map +1 -1
- package/dist/commands/mcp.d.ts +12 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +20 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/render.d.ts +1 -1
- package/dist/commands/render.d.ts.map +1 -1
- package/dist/commands/render.js +149 -156
- package/dist/commands/render.js.map +1 -1
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +20 -12
- package/dist/commands/serve.js.map +1 -1
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +2 -2
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/resvg.wasm +0 -0
- package/man/nowline.1 +41 -3
- package/package.json +17 -12
- package/scripts/bun-entry.mjs +25 -0
- package/scripts/compile.mjs +11 -6
- package/scripts/copy-wasm.mjs +23 -0
- package/src/cli/args.ts +35 -4
- package/src/cli/help.ts +42 -2
- package/src/commands/mcp.ts +21 -0
- package/src/commands/render.ts +194 -177
- package/src/commands/serve.ts +30 -11
- package/src/generated/version.ts +2 -2
- package/src/index.ts +3 -0
package/dist/cli/args.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type ModeKind = 'render' | 'serve' | 'init' | 'help' | 'version';
|
|
1
|
+
export type ModeKind = 'render' | 'serve' | 'init' | 'mcp' | 'help' | 'version';
|
|
2
2
|
export interface ParsedArgs {
|
|
3
3
|
/** Resolved mode after dispatch (mutual-exclusivity already checked). */
|
|
4
4
|
mode: ModeKind;
|
|
@@ -15,9 +15,16 @@ export interface ParsedArgs {
|
|
|
15
15
|
/** Now-line date string from `--now`. Undefined means "use the actual
|
|
16
16
|
* current date" (the default). The literal value `"-"` means
|
|
17
17
|
* "suppress the now-line entirely" (mirrors the Unix-`-` convention
|
|
18
|
-
* used elsewhere in the CLI).
|
|
19
|
-
* parsed downstream by
|
|
18
|
+
* used elsewhere in the CLI). Accepts YYYY-MM-DD (floating) or a
|
|
19
|
+
* full ISO 8601 instant with Z/offset; parsed downstream by resolveToday. */
|
|
20
20
|
now?: string;
|
|
21
|
+
/**
|
|
22
|
+
* IANA timezone name, ISO 8601 offset, `"UTC"`, `"Z"`, or `"local"`.
|
|
23
|
+
* Governs which civil date is "today" when `--now` is omitted.
|
|
24
|
+
* Defaults to the host's local zone when absent.
|
|
25
|
+
* Ignored when `--now` carries an explicit date or embedded offset.
|
|
26
|
+
*/
|
|
27
|
+
timezone?: string;
|
|
21
28
|
noLinks: boolean;
|
|
22
29
|
scale?: string;
|
|
23
30
|
strict: boolean;
|
|
@@ -29,6 +36,12 @@ export interface ParsedArgs {
|
|
|
29
36
|
fontSans?: string;
|
|
30
37
|
fontMono?: string;
|
|
31
38
|
headless: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Opt in to the platform font probe for raster/PDF export. Off by default
|
|
41
|
+
* (bundled-first): exports use the bundled DejaVu pair on every OS so the
|
|
42
|
+
* output is identical cross-platform and matches the live preview.
|
|
43
|
+
*/
|
|
44
|
+
useSystemFonts: boolean;
|
|
32
45
|
start?: string;
|
|
33
46
|
/**
|
|
34
47
|
* BCP-47 locale override (`fr-CA`, `fr`, …). When omitted the CLI
|
|
@@ -42,6 +55,7 @@ export interface ParsedArgs {
|
|
|
42
55
|
open: boolean;
|
|
43
56
|
diagnosticFormat?: string;
|
|
44
57
|
template?: string;
|
|
58
|
+
root?: string;
|
|
45
59
|
}
|
|
46
60
|
/**
|
|
47
61
|
* Pure argument parser. Walks `argv` once, identifies mode flags, applies
|
package/dist/cli/args.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC;AAEhF,MAAM,WAAW,UAAU;IACvB,yEAAyE;IACzE,IAAI,EAAE,QAAQ,CAAC;IACf,uGAAuG;IACvG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0EAA0E;IAC1E,MAAM,EAAE,OAAO,CAAC;IAChB,+DAA+D;IAC/D,QAAQ,EAAE,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;IAGzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;kFAI8E;IAC9E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,cAAc,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IAGd,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAG1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,UAAU,CAqL7D"}
|
package/dist/cli/args.js
CHANGED
|
@@ -17,6 +17,7 @@ export function parseArgv(argv) {
|
|
|
17
17
|
strict: false,
|
|
18
18
|
open: false,
|
|
19
19
|
headless: false,
|
|
20
|
+
useSystemFonts: false,
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
23
|
const config = {
|
|
@@ -33,6 +34,7 @@ export function parseArgv(argv) {
|
|
|
33
34
|
'input-format': { type: 'string' },
|
|
34
35
|
serve: { type: 'boolean' },
|
|
35
36
|
init: { type: 'boolean' },
|
|
37
|
+
mcp: { type: 'boolean' },
|
|
36
38
|
'dry-run': { type: 'boolean', short: 'n' },
|
|
37
39
|
theme: { type: 'string', short: 't' },
|
|
38
40
|
// `--now <date>` overrides the now-line position; without it, the
|
|
@@ -40,6 +42,9 @@ export function parseArgv(argv) {
|
|
|
40
42
|
// suppress the now-line entirely (Unix-`-` sentinel; same idea
|
|
41
43
|
// as `-o -` for stdout).
|
|
42
44
|
now: { type: 'string' },
|
|
45
|
+
// `--timezone` controls which civil date is "today" when --now is
|
|
46
|
+
// omitted. Accepts IANA names, ISO offsets, "UTC", "Z", or "local".
|
|
47
|
+
timezone: { type: 'string' },
|
|
43
48
|
'no-links': { type: 'boolean' },
|
|
44
49
|
scale: { type: 'string', short: 's' },
|
|
45
50
|
strict: { type: 'boolean' },
|
|
@@ -50,6 +55,8 @@ export function parseArgv(argv) {
|
|
|
50
55
|
open: { type: 'boolean' },
|
|
51
56
|
'diagnostic-format': { type: 'string' },
|
|
52
57
|
template: { type: 'string' },
|
|
58
|
+
// MCP
|
|
59
|
+
root: { type: 'string' },
|
|
53
60
|
// Format-specific (m2c)
|
|
54
61
|
'page-size': { type: 'string' },
|
|
55
62
|
orientation: { type: 'string' },
|
|
@@ -57,6 +64,7 @@ export function parseArgv(argv) {
|
|
|
57
64
|
'font-sans': { type: 'string' },
|
|
58
65
|
'font-mono': { type: 'string' },
|
|
59
66
|
headless: { type: 'boolean' },
|
|
67
|
+
'use-system-fonts': { type: 'boolean' },
|
|
60
68
|
start: { type: 'string' },
|
|
61
69
|
// Localization (m-loc-b)
|
|
62
70
|
locale: { type: 'string' },
|
|
@@ -81,6 +89,7 @@ export function parseArgv(argv) {
|
|
|
81
89
|
strict: false,
|
|
82
90
|
open: false,
|
|
83
91
|
headless: false,
|
|
92
|
+
useSystemFonts: false,
|
|
84
93
|
};
|
|
85
94
|
}
|
|
86
95
|
if (values.version === true) {
|
|
@@ -92,6 +101,7 @@ export function parseArgv(argv) {
|
|
|
92
101
|
strict: false,
|
|
93
102
|
open: false,
|
|
94
103
|
headless: false,
|
|
104
|
+
useSystemFonts: false,
|
|
95
105
|
};
|
|
96
106
|
}
|
|
97
107
|
if (values.verbose === true && values.quiet === true) {
|
|
@@ -102,12 +112,14 @@ export function parseArgv(argv) {
|
|
|
102
112
|
modes.push('serve');
|
|
103
113
|
if (values.init === true)
|
|
104
114
|
modes.push('init');
|
|
115
|
+
if (values.mcp === true)
|
|
116
|
+
modes.push('mcp');
|
|
105
117
|
if (modes.length > 1) {
|
|
106
118
|
throw new CliError(ExitCode.InputError, `nowline: --${modes[0]} and --${modes[1]} are mutually exclusive.`);
|
|
107
119
|
}
|
|
108
120
|
const dryRun = values['dry-run'] === true;
|
|
109
121
|
const mode = modes[0] ?? 'render';
|
|
110
|
-
if (dryRun && (mode === 'serve' || mode === 'init')) {
|
|
122
|
+
if (dryRun && (mode === 'serve' || mode === 'init' || mode === 'mcp')) {
|
|
111
123
|
throw new CliError(ExitCode.InputError, `nowline: --dry-run cannot be combined with --${mode}.`);
|
|
112
124
|
}
|
|
113
125
|
if (positionals.length > 1) {
|
|
@@ -128,6 +140,7 @@ export function parseArgv(argv) {
|
|
|
128
140
|
inputFormat: stringOrUndefined(values['input-format']),
|
|
129
141
|
theme: stringOrUndefined(values.theme),
|
|
130
142
|
now: stringOrUndefined(values.now),
|
|
143
|
+
timezone: stringOrUndefined(values.timezone),
|
|
131
144
|
noLinks: values['no-links'] === true,
|
|
132
145
|
scale: stringOrUndefined(values.scale),
|
|
133
146
|
strict: values.strict === true,
|
|
@@ -144,8 +157,10 @@ export function parseArgv(argv) {
|
|
|
144
157
|
fontSans: stringOrUndefined(values['font-sans']),
|
|
145
158
|
fontMono: stringOrUndefined(values['font-mono']),
|
|
146
159
|
headless: values.headless === true,
|
|
160
|
+
useSystemFonts: values['use-system-fonts'] === true,
|
|
147
161
|
start: stringOrUndefined(values.start),
|
|
148
162
|
locale: stringOrUndefined(values.locale),
|
|
163
|
+
root: stringOrUndefined(values.root),
|
|
149
164
|
};
|
|
150
165
|
}
|
|
151
166
|
function stringOrUndefined(value) {
|
package/dist/cli/args.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,SAAS,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,SAAS,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,M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C5C,QAAQ,EAAE,iBAAiB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAChD,WAAW,EAAE,iBAAiB,CAAC,MAAM,CAAC,WAAW,CAAC;QAClD,MAAM,EAAE,iBAAiB,CAAC,MAAM,CAAC,MAAM,CAAC;QACxC,QAAQ,EAAE,iBAAiB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAChD,QAAQ,EAAE,iBAAiB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAChD,QAAQ,EAAE,MAAM,CAAC,QAAQ,KAAK,IAAI;QAClC,cAAc,EAAE,MAAM,CAAC,kBAAkB,CAAC,KAAK,IAAI;QACnD,KAAK,EAAE,iBAAiB,CAAC,MAAM,CAAC,KAAK,CAAC;QACtC,MAAM,EAAE,iBAAiB,CAAC,MAAM,CAAC,MAAM,CAAC;QACxC,IAAI,EAAE,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC;KACvC,CAAC;AACN,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAc;IACrC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,SAAS,gBAAgB,CAAC,OAAe;IACrC,IAAI,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACvC,OAAO,YAAY,OAAO,yBAAyB,CAAC;IACxD,CAAC;IACD,IAAI,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/B,OAAO,YAAY,OAAO,yBAAyB,CAAC;IACxD,CAAC;IACD,OAAO,YAAY,OAAO,EAAE,CAAC;AACjC,CAAC"}
|
package/dist/cli/help.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AA6HA,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC"}
|
package/dist/cli/help.js
CHANGED
|
@@ -30,14 +30,33 @@ MODE FLAGS (mutually exclusive)
|
|
|
30
30
|
rendered output to disk on each rebuild.
|
|
31
31
|
--init [<name>] Scaffold a starter .nowline file in cwd. Positional
|
|
32
32
|
becomes project name; .nowline appended if missing.
|
|
33
|
+
--mcp Start a Model Context Protocol (MCP) stdio server
|
|
34
|
+
exposing validate, render, export, and file tools.
|
|
35
|
+
Shares the same @nowline/mcp server code as
|
|
36
|
+
\`npx @nowline/mcp\`.
|
|
33
37
|
-n, --dry-run Run the full pipeline (parse + validate + layout +
|
|
34
38
|
format) but skip the write step. Subsumes the old
|
|
35
39
|
'validate' verb. Exit 0 on success, 1 on errors.
|
|
36
40
|
|
|
37
41
|
RENDER OPTIONS
|
|
38
42
|
-t, --theme <name> light | dark | grayscale (greyscale alias)
|
|
39
|
-
--now <
|
|
40
|
-
|
|
43
|
+
--now <date> Date for the now-line. Default: today (local civil date).
|
|
44
|
+
Accepts YYYY-MM-DD (floating date, zone-independent) or a
|
|
45
|
+
full ISO 8601 instant: YYYY-MM-DDTHH:MM:SSZ or with a
|
|
46
|
+
±HH:MM offset. A bare date or ISO date without an offset is
|
|
47
|
+
treated as floating (written date part used, --timezone
|
|
48
|
+
ignored). An embedded Z or ±offset overrides --timezone.
|
|
49
|
+
Use --now - to suppress the now-line entirely.
|
|
50
|
+
--timezone <zone> Timezone for the clock-based "today" default.
|
|
51
|
+
Only consulted when --now is omitted; ignored when --now
|
|
52
|
+
carries an explicit date or embedded ISO offset.
|
|
53
|
+
Accepted forms:
|
|
54
|
+
local — host/viewer zone (default)
|
|
55
|
+
UTC — UTC
|
|
56
|
+
Z, +00:00 — zero-offset shorthand (= UTC)
|
|
57
|
+
±HH, ±HH:MM, ±HHMM — fixed offset (DST-naive)
|
|
58
|
+
America/Los_Angeles — IANA timezone name
|
|
59
|
+
Ambiguous abbreviations (PST, IST, CET) are rejected.
|
|
41
60
|
--no-links Omit link icons from rendered items.
|
|
42
61
|
-s, --scale <n> Raster scale factor (PNG only; default 1).
|
|
43
62
|
--strict Promote asset / sanitizer warnings to errors.
|
|
@@ -51,11 +70,30 @@ RENDER OPTIONS
|
|
|
51
70
|
wins for content. Falls back to LC_ALL /
|
|
52
71
|
LC_MESSAGES / LANG, then en-US.
|
|
53
72
|
|
|
73
|
+
FONT OPTIONS (png, pdf)
|
|
74
|
+
Raster/PDF export is bundled-first: by default it
|
|
75
|
+
renders with the bundled DejaVu pair on every OS, so
|
|
76
|
+
output is identical cross-platform and matches the
|
|
77
|
+
live preview.
|
|
78
|
+
--font-sans <ref> Override the sans font: a .ttf/.otf/.ttc path or a
|
|
79
|
+
known alias. A variable font is not rasterizable and
|
|
80
|
+
is replaced by bundled DejaVu (error under --strict).
|
|
81
|
+
--font-mono <ref> Override the mono font (path or alias; same rules).
|
|
82
|
+
--use-system-fonts Opt in to the platform font probe; the first static
|
|
83
|
+
installed font wins (variable fonts skipped), bundled
|
|
84
|
+
if none. Output then varies by machine.
|
|
85
|
+
--headless Force the bundled DejaVu pair, ignoring system fonts
|
|
86
|
+
and --use-system-fonts. Implied in CI without a TTY.
|
|
87
|
+
|
|
54
88
|
SERVE OPTIONS
|
|
55
89
|
-p, --port <n> Port (default: 4318).
|
|
56
90
|
--host <host> Bind address (default: 127.0.0.1).
|
|
57
91
|
--open Open the browser on start.
|
|
58
92
|
|
|
93
|
+
MCP OPTIONS
|
|
94
|
+
--root <dir> Allowed-root directory for file tools (default: cwd).
|
|
95
|
+
File paths are resolved and restricted to this root.
|
|
96
|
+
|
|
59
97
|
LOGGING (mutually exclusive)
|
|
60
98
|
-v, --verbose Print extra diagnostics to stderr.
|
|
61
99
|
-q, --quiet Suppress non-error stderr.
|
|
@@ -74,6 +112,8 @@ EXAMPLES
|
|
|
74
112
|
nowline roadmap.nowline --dry-run # validate-only
|
|
75
113
|
nowline roadmap.nowline --serve -p 8080 # live preview
|
|
76
114
|
nowline --init my-project # scaffold ./my-project.nowline
|
|
115
|
+
nowline --mcp # start MCP stdio server in cwd
|
|
116
|
+
nowline --mcp --root ./roadmaps # MCP server with custom root
|
|
77
117
|
|
|
78
118
|
EXIT CODES
|
|
79
119
|
0 Success
|
package/dist/cli/help.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,sEAAsE;AACtE,oEAAoE;AACpE,2DAA2D;AAC3D,MAAM,SAAS,GAAG,WAAW,iBAAiB,EAAE
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,sEAAsE;AACtE,oEAAoE;AACpE,2DAA2D;AAC3D,MAAM,SAAS,GAAG,WAAW,iBAAiB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsH/C,CAAC;AAEF,MAAM,UAAU,UAAU;IACtB,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,aAAa;IACzB,OAAO,GAAG,iBAAiB,EAAE,IAAI,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ParsedArgs } from '../cli/args.js';
|
|
2
|
+
/**
|
|
3
|
+
* `nowline --mcp` handler.
|
|
4
|
+
*
|
|
5
|
+
* Starts a Model Context Protocol stdio server sharing the same @nowline/mcp
|
|
6
|
+
* server factory as `npx @nowline/mcp`. Runs until the process receives
|
|
7
|
+
* SIGINT/SIGTERM or the client closes stdin.
|
|
8
|
+
*/
|
|
9
|
+
export declare function mcpHandler({ args }: {
|
|
10
|
+
args: ParsedArgs;
|
|
11
|
+
}): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=mcp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/commands/mcp.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;;;GAMG;AACH,wBAAsB,UAAU,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAS9E"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
2
|
+
import { createMcpServer } from '@nowline/mcp/server';
|
|
3
|
+
/**
|
|
4
|
+
* `nowline --mcp` handler.
|
|
5
|
+
*
|
|
6
|
+
* Starts a Model Context Protocol stdio server sharing the same @nowline/mcp
|
|
7
|
+
* server factory as `npx @nowline/mcp`. Runs until the process receives
|
|
8
|
+
* SIGINT/SIGTERM or the client closes stdin.
|
|
9
|
+
*/
|
|
10
|
+
export async function mcpHandler({ args }) {
|
|
11
|
+
const root = args.root ?? process.cwd();
|
|
12
|
+
const server = createMcpServer({ allowedRoot: root });
|
|
13
|
+
const transport = new StdioServerTransport();
|
|
14
|
+
await server.connect(transport);
|
|
15
|
+
// Keep alive: the transport closes when stdin closes or the process is signalled.
|
|
16
|
+
await new Promise((resolve) => {
|
|
17
|
+
transport.onclose = resolve;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=mcp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/commands/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,EAAE,IAAI,EAAwB;IAC3D,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IACxC,MAAM,MAAM,GAAG,eAAe,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;IACtD,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,kFAAkF;IAClF,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;QAChC,SAAS,CAAC,OAAO,GAAG,OAAO,CAAC;IAChC,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/commands/render.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/commands/render.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAwBjD,MAAM,WAAW,oBAAoB;IACjC,IAAI,EAAE,UAAU,CAAC;IACjB,4DAA4D;IAC5D,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CA6FhF;AAiaD,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,CAWpE"}
|