markdown-markdown 0.2.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/AGENT.md +47 -0
- package/LICENSE +21 -0
- package/README.md +110 -0
- package/dist/cli.d.ts +13 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +308 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/lifecycle.d.ts +18 -0
- package/dist/lib/lifecycle.d.ts.map +1 -0
- package/dist/lib/lifecycle.js +48 -0
- package/dist/lib/lifecycle.js.map +1 -0
- package/dist/lib/review.d.ts +27 -0
- package/dist/lib/review.d.ts.map +1 -0
- package/dist/lib/review.js +124 -0
- package/dist/lib/review.js.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +6 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/server/browser.d.ts +13 -0
- package/dist/server/browser.d.ts.map +1 -0
- package/dist/server/browser.js +135 -0
- package/dist/server/browser.js.map +1 -0
- package/dist/server/runtime.d.ts +15 -0
- package/dist/server/runtime.d.ts.map +1 -0
- package/dist/server/runtime.js +69 -0
- package/dist/server/runtime.js.map +1 -0
- package/dist/server/session.d.ts +12 -0
- package/dist/server/session.d.ts.map +1 -0
- package/dist/server/session.js +61 -0
- package/dist/server/session.js.map +1 -0
- package/dist/server/tunnel.d.ts +13 -0
- package/dist/server/tunnel.d.ts.map +1 -0
- package/dist/server/tunnel.js +131 -0
- package/dist/server/tunnel.js.map +1 -0
- package/dist/types.d.ts +64 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/web/assets/_baseUniq-DWSAgCYE.js +1 -0
- package/dist/web/assets/arc-BLgyBygL.js +1 -0
- package/dist/web/assets/architectureDiagram-Q4EWVU46-WgZ5UMvM.js +36 -0
- package/dist/web/assets/blockDiagram-DXYQGD6D-CLfiyr9S.js +132 -0
- package/dist/web/assets/c4Diagram-AHTNJAMY-DetWrVzN.js +10 -0
- package/dist/web/assets/channel-B52zE7C-.js +1 -0
- package/dist/web/assets/chunk-4BX2VUAB-CwFW4HRp.js +1 -0
- package/dist/web/assets/chunk-4TB4RGXK-jdkxDJTI.js +206 -0
- package/dist/web/assets/chunk-55IACEB6-LHLQ9Mhr.js +1 -0
- package/dist/web/assets/chunk-EDXVE4YY-gXBG7iiV.js +1 -0
- package/dist/web/assets/chunk-FMBD7UC4-D0c2ufl0.js +15 -0
- package/dist/web/assets/chunk-OYMX7WX6-Cam5t0AC.js +231 -0
- package/dist/web/assets/chunk-QZHKN3VN-VDTy7PR1.js +1 -0
- package/dist/web/assets/chunk-YZCP3GAM-DDQlY4hF.js +1 -0
- package/dist/web/assets/classDiagram-6PBFFD2Q-Bn5mNtvt.js +1 -0
- package/dist/web/assets/classDiagram-v2-HSJHXN6E-Bn5mNtvt.js +1 -0
- package/dist/web/assets/clone-CWdO33LD.js +1 -0
- package/dist/web/assets/cose-bilkent-S5V4N54A-CydpJVOO.js +1 -0
- package/dist/web/assets/cytoscape.esm-DxGcaOPV.js +331 -0
- package/dist/web/assets/dagre-KV5264BT-DfWRqVQs.js +4 -0
- package/dist/web/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/dist/web/assets/diagram-5BDNPKRD-DYocjsGb.js +10 -0
- package/dist/web/assets/diagram-G4DWMVQ6-BwxP9kS5.js +24 -0
- package/dist/web/assets/diagram-MMDJMWI5-BmV1mUfz.js +43 -0
- package/dist/web/assets/diagram-TYMM5635-DMUZyCDV.js +24 -0
- package/dist/web/assets/erDiagram-SMLLAGMA-CDgJ2VS3.js +85 -0
- package/dist/web/assets/flowDiagram-DWJPFMVM-aLxzOWpe.js +162 -0
- package/dist/web/assets/ganttDiagram-T4ZO3ILL-ct-v0U4O.js +292 -0
- package/dist/web/assets/gitGraphDiagram-UUTBAWPF-DJ-FLYU_.js +106 -0
- package/dist/web/assets/graph-DUCnU9ms.js +1 -0
- package/dist/web/assets/index-D7013kRO.js +492 -0
- package/dist/web/assets/index-Lxs7QZQJ.css +1 -0
- package/dist/web/assets/infoDiagram-42DDH7IO-DmMBz9mk.js +2 -0
- package/dist/web/assets/init-Gi6I4Gst.js +1 -0
- package/dist/web/assets/ishikawaDiagram-UXIWVN3A-D-dfZT_7.js +70 -0
- package/dist/web/assets/journeyDiagram-VCZTEJTY-DCLyO8ny.js +139 -0
- package/dist/web/assets/kanban-definition-6JOO6SKY-DaSer7-n.js +89 -0
- package/dist/web/assets/katex-DkKDou_j.js +257 -0
- package/dist/web/assets/layout-BaZRT940.js +1 -0
- package/dist/web/assets/linear-CH1vCRmv.js +1 -0
- package/dist/web/assets/min-C200fz71.js +1 -0
- package/dist/web/assets/mindmap-definition-QFDTVHPH-CCqZjE9I.js +96 -0
- package/dist/web/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dist/web/assets/pieDiagram-DEJITSTG-Beh4XRu6.js +30 -0
- package/dist/web/assets/quadrantDiagram-34T5L4WZ-DOPc33qF.js +7 -0
- package/dist/web/assets/requirementDiagram-MS252O5E-DwblBLZK.js +84 -0
- package/dist/web/assets/sankeyDiagram-XADWPNL6-DlMTDWAl.js +10 -0
- package/dist/web/assets/sequenceDiagram-FGHM5R23-CPvNK8NS.js +157 -0
- package/dist/web/assets/stateDiagram-FHFEXIEX-C51anF0K.js +1 -0
- package/dist/web/assets/stateDiagram-v2-QKLJ7IA2-DgIcCuV2.js +1 -0
- package/dist/web/assets/timeline-definition-GMOUNBTQ-B0M6txNM.js +120 -0
- package/dist/web/assets/vennDiagram-DHZGUBPP-DuNg6iKA.js +34 -0
- package/dist/web/assets/wardley-RL74JXVD-CnLmvQxW.js +162 -0
- package/dist/web/assets/wardleyDiagram-NUSXRM2D-DVMWnQbQ.js +20 -0
- package/dist/web/assets/xychartDiagram-5P7HB3ND-Cec8luZO.js +7 -0
- package/dist/web/index.html +14 -0
- package/package.json +67 -0
package/AGENT.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Agent Guide
|
|
2
|
+
|
|
3
|
+
This repository is a Vite + React + TypeScript package that ships a Markdown review CLI plus a local browser UI.
|
|
4
|
+
|
|
5
|
+
For agent-facing usage guidance, use the separate [`markdown-markdown-skill`](https://github.com/zhouchangui/markdown-markdown-skill) repository. Keep this repo focused on the CLI, local web service, and browser experience.
|
|
6
|
+
|
|
7
|
+
## Project Layout
|
|
8
|
+
|
|
9
|
+
- `src/App.tsx` is the browser application shell.
|
|
10
|
+
- `src/main.tsx` mounts the React app.
|
|
11
|
+
- `src/cli.ts` is the Node CLI entrypoint.
|
|
12
|
+
- `src/server/` contains the local HTTP runtime and browser launcher.
|
|
13
|
+
- `src/components/` contains UI building blocks such as the sidebar, markdown viewer, inline annotation form, hoverable blocks, and Mermaid rendering.
|
|
14
|
+
- `src/lib/` contains shared helpers.
|
|
15
|
+
- `src/index.ts` exports reusable package APIs.
|
|
16
|
+
- `src/index.css` defines the global styling layer.
|
|
17
|
+
|
|
18
|
+
## Setup And Run
|
|
19
|
+
|
|
20
|
+
- Install dependencies with `npm install`.
|
|
21
|
+
- Start local development with `npm run dev`.
|
|
22
|
+
- Build production assets with `npm run build`.
|
|
23
|
+
- Run TypeScript checks with `npm run lint`.
|
|
24
|
+
- Run the test suite with `npm test`.
|
|
25
|
+
- Publish releases through GitHub Actions on `v*` tags; avoid local `npm publish` except for bootstrap or debugging.
|
|
26
|
+
|
|
27
|
+
## Environment
|
|
28
|
+
|
|
29
|
+
- Set `GEMINI_API_KEY` in `.env.local` before running features that depend on Gemini.
|
|
30
|
+
- The browser UI falls back to a demo session in Vite dev mode if the local review server is unavailable.
|
|
31
|
+
- If `cloudflared` is present, the CLI opens the review session through a public tunnel; otherwise it uses `localhost`.
|
|
32
|
+
- Use `--cloudflare` to require a tunnel, `--no-cloudflare` to force localhost, `--output <file>` to persist the final JSON, and `--status-file <file>` to emit agent-friendly lifecycle updates.
|
|
33
|
+
- Use `--browser system` if you want the review session to open in the system default browser instead of the compact app-style window.
|
|
34
|
+
|
|
35
|
+
## Working Rules
|
|
36
|
+
|
|
37
|
+
- Prefer small, focused edits that fit the existing component structure.
|
|
38
|
+
- Reuse existing utilities and components before introducing new abstractions.
|
|
39
|
+
- Keep TypeScript types aligned with UI changes.
|
|
40
|
+
- Preserve the markdown rendering and annotation flow unless the task explicitly asks to change it.
|
|
41
|
+
- Avoid adding dependencies unless they are clearly required.
|
|
42
|
+
|
|
43
|
+
## Verification
|
|
44
|
+
|
|
45
|
+
- For UI or TypeScript changes, run `npm run lint`.
|
|
46
|
+
- For broader changes, also run `npm run build`.
|
|
47
|
+
- For runtime changes, also run `npm test`.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 zhouchangui
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# markdown-markdown
|
|
2
|
+
|
|
3
|
+
Local Markdown review and annotation CLI.
|
|
4
|
+
|
|
5
|
+
Point it at a single Markdown file or a directory of Markdown files, make annotations in the browser, then submit once you are done. The command exits and prints a JSON payload that can be handed to an AI system or another automation step.
|
|
6
|
+
|
|
7
|
+
## Companion Skill
|
|
8
|
+
|
|
9
|
+
If you want agent instructions for using this CLI, install the separate [`markdown-markdown-skill`](https://github.com/zhouchangui/markdown-markdown-skill) repository. This package stays focused on the CLI and browser runtime.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Build
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm run build
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
This produces:
|
|
24
|
+
|
|
25
|
+
- `dist/cli.js` for the command-line entrypoint
|
|
26
|
+
- `dist/index.js` for shared exports
|
|
27
|
+
- `dist/web/` for the browser UI
|
|
28
|
+
|
|
29
|
+
## Release
|
|
30
|
+
|
|
31
|
+
Releases are handled by GitHub Actions. Push a tag that starts with `v` such as `v0.1.1`, and the workflow will build and publish the package to npm.
|
|
32
|
+
|
|
33
|
+
The workflow uses GitHub Actions trusted publishing, so no npm token needs to be stored in the repository.
|
|
34
|
+
|
|
35
|
+
## Use
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx markdown-markdown ./docs
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
or
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npx markdown-markdown ./docs/spec.md
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
To open the session in the system default browser instead of the compact app-style window, use:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npx markdown-markdown --browser system ./docs/spec.md
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
To force a Cloudflare public URL and fail fast when `cloudflared` is missing:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npx markdown-markdown --cloudflare ./docs/spec.md
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
To force localhost only, even if `cloudflared` is installed:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
npx markdown-markdown --no-cloudflare ./docs/spec.md
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
To write the final review JSON and a lightweight lifecycle status file for agents to poll:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npx markdown-markdown --output ./out/review.json --status-file ./out/review.status.json ./docs/spec.md
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
The CLI will:
|
|
72
|
+
|
|
73
|
+
- discover Markdown files
|
|
74
|
+
- launch a local web session
|
|
75
|
+
- use a public Cloudflare tunnel when `cloudflared` is installed, unless you pass `--no-cloudflare`
|
|
76
|
+
- fail fast with a clear install message when you pass `--cloudflare` but `cloudflared` is missing
|
|
77
|
+
- let you annotate headings, paragraphs, blockquotes, lists, tables, code blocks, images, and horizontal rules
|
|
78
|
+
- submit the annotations and close the browser
|
|
79
|
+
- print the final JSON result to stdout
|
|
80
|
+
- optionally write the final JSON to `--output`
|
|
81
|
+
- optionally write running/completed/failed status snapshots to `--status-file`
|
|
82
|
+
|
|
83
|
+
## Output
|
|
84
|
+
|
|
85
|
+
The submitted JSON includes:
|
|
86
|
+
|
|
87
|
+
- `rootPath`
|
|
88
|
+
- `mode`
|
|
89
|
+
- `files`
|
|
90
|
+
- `annotations`
|
|
91
|
+
- `prompt`
|
|
92
|
+
- `submittedAt`
|
|
93
|
+
|
|
94
|
+
The `prompt` field is a ready-to-send Markdown summary of the requested changes, grouped by file with short anchor text and line ranges so an AI can locate the target block without extra token cost.
|
|
95
|
+
|
|
96
|
+
If you use `--status-file`, the agent-friendly lifecycle file will move through:
|
|
97
|
+
|
|
98
|
+
- `running`
|
|
99
|
+
- `completed`
|
|
100
|
+
- `failed`
|
|
101
|
+
|
|
102
|
+
That file is the simplest way to know when an asynchronous caller should consider the review finished.
|
|
103
|
+
|
|
104
|
+
## Development
|
|
105
|
+
|
|
106
|
+
- `npm run dev` runs the Vite UI in demo mode
|
|
107
|
+
- `npm run lint` runs TypeScript checks
|
|
108
|
+
- `npm test` runs the test suite
|
|
109
|
+
|
|
110
|
+
If the app cannot reach the local review service during development, it falls back to a built-in demo session so you can still work on the UI.
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import type { BrowserMode, CloudflareMode } from './types.js';
|
|
3
|
+
export interface ParsedCliArgs {
|
|
4
|
+
targetArg: string | null;
|
|
5
|
+
browserMode: BrowserMode;
|
|
6
|
+
cloudflareMode: CloudflareMode;
|
|
7
|
+
outputPath: string | null;
|
|
8
|
+
statusPath: string | null;
|
|
9
|
+
helpRequested: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function parseCliArgs(argv: string[]): ParsedCliArgs;
|
|
12
|
+
export declare function isDirectExecutionEntry(argv1: string | undefined, moduleUrl: string): boolean;
|
|
13
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE9D,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,WAAW,EAAE,WAAW,CAAC;IACzB,cAAc,EAAE,cAAc,CAAC;IAC/B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;CACxB;AA0BD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,aAAa,CAsI1D;AAmMD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAS5F"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { existsSync, realpathSync } from 'node:fs';
|
|
3
|
+
import { stat } from 'node:fs/promises';
|
|
4
|
+
import { randomUUID } from 'node:crypto';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
import { buildCompletedStatus, buildFailedStatus, buildRunningStatus, writeJsonFile } from './lib/lifecycle.js';
|
|
8
|
+
import { discoverMarkdownFiles } from './server/session.js';
|
|
9
|
+
import { launchBrowser } from './server/browser.js';
|
|
10
|
+
import { hasCloudflaredExecutable, launchCloudflaredTunnel } from './server/tunnel.js';
|
|
11
|
+
import { startReviewRuntime } from './server/runtime.js';
|
|
12
|
+
function resolveRealpath(candidate) {
|
|
13
|
+
try {
|
|
14
|
+
return realpathSync(candidate);
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return path.resolve(candidate);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function printUsage() {
|
|
21
|
+
console.error([
|
|
22
|
+
'Usage: markdown-markdown [options] <file-or-directory>',
|
|
23
|
+
'',
|
|
24
|
+
'Options:',
|
|
25
|
+
' --browser app|system Browser launch mode (default: app)',
|
|
26
|
+
' --cloudflare Require a Cloudflare tunnel',
|
|
27
|
+
' --cloudflare=auto|required|off',
|
|
28
|
+
' --no-cloudflare Force localhost only',
|
|
29
|
+
' --output <file> Write the final review JSON to a file',
|
|
30
|
+
' --status-file <file> Write running/completed status updates to a file',
|
|
31
|
+
].join('\n'));
|
|
32
|
+
}
|
|
33
|
+
export function parseCliArgs(argv) {
|
|
34
|
+
let browserMode = 'app';
|
|
35
|
+
let cloudflareMode = 'auto';
|
|
36
|
+
let outputPath = null;
|
|
37
|
+
let statusPath = null;
|
|
38
|
+
let targetArg = null;
|
|
39
|
+
let parsingOptions = true;
|
|
40
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
41
|
+
const arg = argv[index];
|
|
42
|
+
if (parsingOptions && arg === '--') {
|
|
43
|
+
parsingOptions = false;
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if (parsingOptions && (arg === '--help' || arg === '-h')) {
|
|
47
|
+
return {
|
|
48
|
+
targetArg: null,
|
|
49
|
+
browserMode,
|
|
50
|
+
cloudflareMode,
|
|
51
|
+
outputPath,
|
|
52
|
+
statusPath,
|
|
53
|
+
helpRequested: true,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
if (parsingOptions && (arg === '--system-browser' || arg === '--browser=system')) {
|
|
57
|
+
browserMode = 'system';
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
if (parsingOptions && (arg === '--app-browser' || arg === '--browser=app')) {
|
|
61
|
+
browserMode = 'app';
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
if (parsingOptions && arg === '--cloudflare') {
|
|
65
|
+
cloudflareMode = 'required';
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
if (parsingOptions && arg === '--no-cloudflare') {
|
|
69
|
+
cloudflareMode = 'off';
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
if (parsingOptions && arg.startsWith('--cloudflare=')) {
|
|
73
|
+
const mode = arg.slice('--cloudflare='.length);
|
|
74
|
+
if (mode !== 'auto' && mode !== 'required' && mode !== 'off') {
|
|
75
|
+
throw new Error(`Unsupported cloudflare mode: ${mode}`);
|
|
76
|
+
}
|
|
77
|
+
cloudflareMode = mode;
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
if (parsingOptions && (arg === '--output' || arg === '--output-file')) {
|
|
81
|
+
const nextValue = argv[index + 1];
|
|
82
|
+
if (!nextValue) {
|
|
83
|
+
throw new Error(`Missing value for ${arg}.`);
|
|
84
|
+
}
|
|
85
|
+
outputPath = nextValue;
|
|
86
|
+
index += 1;
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
if (parsingOptions && (arg.startsWith('--output=') || arg.startsWith('--output-file='))) {
|
|
90
|
+
const value = arg.includes('=') ? arg.slice(arg.indexOf('=') + 1) : '';
|
|
91
|
+
if (!value) {
|
|
92
|
+
throw new Error(`Missing value for ${arg}.`);
|
|
93
|
+
}
|
|
94
|
+
outputPath = value;
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
if (parsingOptions && (arg === '--status-file')) {
|
|
98
|
+
const nextValue = argv[index + 1];
|
|
99
|
+
if (!nextValue) {
|
|
100
|
+
throw new Error(`Missing value for ${arg}.`);
|
|
101
|
+
}
|
|
102
|
+
statusPath = nextValue;
|
|
103
|
+
index += 1;
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
if (parsingOptions && arg.startsWith('--status-file=')) {
|
|
107
|
+
const value = arg.slice('--status-file='.length);
|
|
108
|
+
if (!value) {
|
|
109
|
+
throw new Error(`Missing value for ${arg}.`);
|
|
110
|
+
}
|
|
111
|
+
statusPath = value;
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
if (parsingOptions && arg === '--browser') {
|
|
115
|
+
const browserValue = argv[index + 1];
|
|
116
|
+
if (!browserValue) {
|
|
117
|
+
throw new Error('Missing value for --browser.');
|
|
118
|
+
}
|
|
119
|
+
if (browserValue !== 'app' && browserValue !== 'system') {
|
|
120
|
+
throw new Error(`Unsupported browser mode: ${browserValue}`);
|
|
121
|
+
}
|
|
122
|
+
browserMode = browserValue;
|
|
123
|
+
index += 1;
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
if (parsingOptions && arg.startsWith('-')) {
|
|
127
|
+
throw new Error(`Unknown option: ${arg}`);
|
|
128
|
+
}
|
|
129
|
+
if (targetArg === null) {
|
|
130
|
+
targetArg = arg;
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
throw new Error(`Unexpected argument: ${arg}`);
|
|
134
|
+
}
|
|
135
|
+
return {
|
|
136
|
+
targetArg,
|
|
137
|
+
browserMode,
|
|
138
|
+
cloudflareMode,
|
|
139
|
+
outputPath,
|
|
140
|
+
statusPath,
|
|
141
|
+
helpRequested: false,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function resolveStaticDir() {
|
|
145
|
+
const scriptDir = path.dirname(fileURLToPath(import.meta.url));
|
|
146
|
+
const candidates = [
|
|
147
|
+
path.join(scriptDir, 'web'),
|
|
148
|
+
path.join(scriptDir, '..', 'dist', 'web'),
|
|
149
|
+
path.resolve(process.cwd(), 'dist', 'web'),
|
|
150
|
+
];
|
|
151
|
+
for (const candidate of candidates) {
|
|
152
|
+
if (existsSync(candidate)) {
|
|
153
|
+
return candidate;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
async function writeLifecycleArtifact(filePath, value, label) {
|
|
159
|
+
if (!filePath) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
try {
|
|
163
|
+
await writeJsonFile(filePath, value);
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
console.error(`Failed to write ${label} at ${filePath}: ${error instanceof Error ? error.message : String(error)}`);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
async function runReviewSession(parsedArgs, targetPath, mode, files, staticDir) {
|
|
170
|
+
const resolvedOutputPath = parsedArgs.outputPath ? path.resolve(process.cwd(), parsedArgs.outputPath) : null;
|
|
171
|
+
const resolvedStatusPath = parsedArgs.statusPath ? path.resolve(process.cwd(), parsedArgs.statusPath) : null;
|
|
172
|
+
const sessionId = randomUUID();
|
|
173
|
+
const startedAt = new Date().toISOString();
|
|
174
|
+
const runtime = await startReviewRuntime({
|
|
175
|
+
rootPath: targetPath,
|
|
176
|
+
mode,
|
|
177
|
+
files,
|
|
178
|
+
staticDir,
|
|
179
|
+
});
|
|
180
|
+
let browser = null;
|
|
181
|
+
let tunnel = null;
|
|
182
|
+
const shutdown = async () => {
|
|
183
|
+
await browser?.close();
|
|
184
|
+
await tunnel?.close();
|
|
185
|
+
await runtime.close();
|
|
186
|
+
};
|
|
187
|
+
const lifecycleContext = {
|
|
188
|
+
sessionId,
|
|
189
|
+
rootPath: targetPath,
|
|
190
|
+
mode,
|
|
191
|
+
browserMode: parsedArgs.browserMode,
|
|
192
|
+
cloudflareMode: parsedArgs.cloudflareMode,
|
|
193
|
+
reviewUrl: runtime.url,
|
|
194
|
+
publicUrl: null,
|
|
195
|
+
outputPath: resolvedOutputPath,
|
|
196
|
+
statusPath: resolvedStatusPath,
|
|
197
|
+
startedAt,
|
|
198
|
+
};
|
|
199
|
+
const handleSignal = async () => {
|
|
200
|
+
await shutdown();
|
|
201
|
+
process.exit(130);
|
|
202
|
+
};
|
|
203
|
+
const onSigint = () => {
|
|
204
|
+
void handleSignal();
|
|
205
|
+
};
|
|
206
|
+
const onSigterm = () => {
|
|
207
|
+
void handleSignal();
|
|
208
|
+
};
|
|
209
|
+
process.once('SIGINT', onSigint);
|
|
210
|
+
process.once('SIGTERM', onSigterm);
|
|
211
|
+
try {
|
|
212
|
+
if (resolvedOutputPath) {
|
|
213
|
+
console.error(`Writing final review JSON to: ${resolvedOutputPath}`);
|
|
214
|
+
}
|
|
215
|
+
if (resolvedStatusPath) {
|
|
216
|
+
console.error(`Writing lifecycle status to: ${resolvedStatusPath}`);
|
|
217
|
+
}
|
|
218
|
+
if (parsedArgs.cloudflareMode === 'required' && !hasCloudflaredExecutable()) {
|
|
219
|
+
throw new Error('Cloudflare tunnel was requested, but cloudflared is not installed. Install cloudflared or rerun with --no-cloudflare.');
|
|
220
|
+
}
|
|
221
|
+
if (parsedArgs.cloudflareMode !== 'off') {
|
|
222
|
+
tunnel = await launchCloudflaredTunnel(runtime.url);
|
|
223
|
+
if (parsedArgs.cloudflareMode === 'required' && !tunnel) {
|
|
224
|
+
throw new Error('Cloudflare tunnel was requested, but cloudflared could not start. Install cloudflared or rerun with --no-cloudflare.');
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
const launchUrl = tunnel?.publicUrl ?? runtime.url;
|
|
228
|
+
lifecycleContext.reviewUrl = launchUrl;
|
|
229
|
+
lifecycleContext.publicUrl = tunnel?.publicUrl ?? null;
|
|
230
|
+
if (tunnel) {
|
|
231
|
+
console.error(`Cloudflare tunnel active: ${tunnel.publicUrl}`);
|
|
232
|
+
}
|
|
233
|
+
else if (parsedArgs.cloudflareMode === 'off') {
|
|
234
|
+
console.error(`Cloudflare disabled; using local review URL: ${runtime.url}`);
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
console.error(`Using local review URL: ${runtime.url}`);
|
|
238
|
+
}
|
|
239
|
+
browser =
|
|
240
|
+
parsedArgs.browserMode === 'system'
|
|
241
|
+
? await launchBrowser(launchUrl, { executableCandidates: [] })
|
|
242
|
+
: await launchBrowser(launchUrl);
|
|
243
|
+
await writeLifecycleArtifact(resolvedStatusPath, buildRunningStatus(lifecycleContext), 'status file');
|
|
244
|
+
const result = await runtime.result;
|
|
245
|
+
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
246
|
+
await writeLifecycleArtifact(resolvedOutputPath, result, 'output file');
|
|
247
|
+
await writeLifecycleArtifact(resolvedStatusPath, buildCompletedStatus(lifecycleContext, result.submittedAt, result.annotations.length), 'status file');
|
|
248
|
+
}
|
|
249
|
+
catch (error) {
|
|
250
|
+
await writeLifecycleArtifact(resolvedStatusPath, buildFailedStatus(lifecycleContext, error instanceof Error ? error.message : String(error)), 'status file');
|
|
251
|
+
throw error;
|
|
252
|
+
}
|
|
253
|
+
finally {
|
|
254
|
+
process.off('SIGINT', onSigint);
|
|
255
|
+
process.off('SIGTERM', onSigterm);
|
|
256
|
+
await shutdown();
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
async function main() {
|
|
260
|
+
let parsedArgs;
|
|
261
|
+
try {
|
|
262
|
+
parsedArgs = parseCliArgs(process.argv.slice(2));
|
|
263
|
+
}
|
|
264
|
+
catch (error) {
|
|
265
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
266
|
+
printUsage();
|
|
267
|
+
process.exit(1);
|
|
268
|
+
}
|
|
269
|
+
if (parsedArgs.helpRequested) {
|
|
270
|
+
printUsage();
|
|
271
|
+
process.exit(0);
|
|
272
|
+
}
|
|
273
|
+
if (!parsedArgs.targetArg) {
|
|
274
|
+
printUsage();
|
|
275
|
+
process.exit(1);
|
|
276
|
+
}
|
|
277
|
+
const targetPath = path.resolve(process.cwd(), parsedArgs.targetArg);
|
|
278
|
+
const targetStats = await stat(targetPath).catch(() => null);
|
|
279
|
+
if (!targetStats) {
|
|
280
|
+
throw new Error(`Target path does not exist: ${targetPath}`);
|
|
281
|
+
}
|
|
282
|
+
const mode = targetStats.isFile() ? 'file' : 'directory';
|
|
283
|
+
const files = await discoverMarkdownFiles(targetPath);
|
|
284
|
+
if (files.length === 0) {
|
|
285
|
+
throw new Error(`No markdown files found under: ${targetPath}`);
|
|
286
|
+
}
|
|
287
|
+
const staticDir = resolveStaticDir();
|
|
288
|
+
if (!staticDir) {
|
|
289
|
+
throw new Error('Build output not found. Run the package build before starting the CLI.');
|
|
290
|
+
}
|
|
291
|
+
await runReviewSession(parsedArgs, targetPath, mode, files, staticDir);
|
|
292
|
+
}
|
|
293
|
+
export function isDirectExecutionEntry(argv1, moduleUrl) {
|
|
294
|
+
if (!argv1) {
|
|
295
|
+
return false;
|
|
296
|
+
}
|
|
297
|
+
const entryPath = resolveRealpath(argv1);
|
|
298
|
+
const modulePath = resolveRealpath(fileURLToPath(moduleUrl));
|
|
299
|
+
return entryPath === modulePath;
|
|
300
|
+
}
|
|
301
|
+
const isDirectExecution = isDirectExecutionEntry(process.argv[1], import.meta.url);
|
|
302
|
+
if (isDirectExecution) {
|
|
303
|
+
void main().catch(async (error) => {
|
|
304
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
305
|
+
process.exitCode = 1;
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,kBAAkB,EAAyB,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACvI,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAYzD,SAAS,eAAe,CAAC,SAAiB;IACxC,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;AACH,CAAC;AAED,SAAS,UAAU;IACjB,OAAO,CAAC,KAAK,CACX;QACE,wDAAwD;QACxD,EAAE;QACF,UAAU;QACV,kEA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,CAAC;IACtB,KAAK,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,KAAc,EAAE,EAAE;QACzC,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACtE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { buildReviewPrompt } from './lib/review.js';
|
|
2
|
+
export { discoverMarkdownFiles } from './server/session.js';
|
|
3
|
+
export type { ReviewPromptInput } from './lib/review.js';
|
|
4
|
+
export type { MarkdownSource } from './server/session.js';
|
|
5
|
+
export type { Annotation, MarkdownFile, ReviewSessionData, ReviewSubmissionPayload, ReviewSubmissionResult, SelectionInfo, } from './types.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,YAAY,EACV,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,EACtB,aAAa,GACd,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { BrowserMode, CloudflareMode, ReviewLifecycleStatus } from '../types.js';
|
|
2
|
+
export interface LifecycleContext {
|
|
3
|
+
sessionId: string;
|
|
4
|
+
rootPath: string;
|
|
5
|
+
mode: 'file' | 'directory';
|
|
6
|
+
browserMode: BrowserMode;
|
|
7
|
+
cloudflareMode: CloudflareMode;
|
|
8
|
+
reviewUrl: string;
|
|
9
|
+
publicUrl: string | null;
|
|
10
|
+
outputPath: string | null;
|
|
11
|
+
statusPath: string | null;
|
|
12
|
+
startedAt: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function writeJsonFile(filePath: string, value: unknown): Promise<void>;
|
|
15
|
+
export declare function buildRunningStatus(context: LifecycleContext): ReviewLifecycleStatus;
|
|
16
|
+
export declare function buildCompletedStatus(context: LifecycleContext, submittedAt: string, annotationCount: number): ReviewLifecycleStatus;
|
|
17
|
+
export declare function buildFailedStatus(context: LifecycleContext, error: string): ReviewLifecycleStatus;
|
|
18
|
+
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../src/lib/lifecycle.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,qBAAqB,EAA6B,MAAM,aAAa,CAAC;AAEjH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,WAAW,EAAE,WAAW,CAAC;IACzB,cAAc,EAAE,cAAc,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAGnF;AAkBD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,GAAG,qBAAqB,CAOnF;AAED,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,gBAAgB,EACzB,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,GACtB,qBAAqB,CAUvB;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,GAAG,qBAAqB,CASjG"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { mkdir, writeFile } from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
export async function writeJsonFile(filePath, value) {
|
|
4
|
+
await mkdir(path.dirname(filePath), { recursive: true });
|
|
5
|
+
await writeFile(filePath, `${JSON.stringify(value, null, 2)}\n`, 'utf8');
|
|
6
|
+
}
|
|
7
|
+
function buildBaseStatus(context, updatedAt) {
|
|
8
|
+
return {
|
|
9
|
+
sessionId: context.sessionId,
|
|
10
|
+
rootPath: context.rootPath,
|
|
11
|
+
mode: context.mode,
|
|
12
|
+
browserMode: context.browserMode,
|
|
13
|
+
cloudflareMode: context.cloudflareMode,
|
|
14
|
+
reviewUrl: context.reviewUrl,
|
|
15
|
+
publicUrl: context.publicUrl,
|
|
16
|
+
outputPath: context.outputPath,
|
|
17
|
+
statusPath: context.statusPath,
|
|
18
|
+
startedAt: context.startedAt,
|
|
19
|
+
updatedAt,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export function buildRunningStatus(context) {
|
|
23
|
+
const updatedAt = new Date().toISOString();
|
|
24
|
+
return {
|
|
25
|
+
...buildBaseStatus(context, updatedAt),
|
|
26
|
+
phase: 'running',
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export function buildCompletedStatus(context, submittedAt, annotationCount) {
|
|
30
|
+
const completedAt = new Date().toISOString();
|
|
31
|
+
return {
|
|
32
|
+
...buildBaseStatus(context, completedAt),
|
|
33
|
+
annotationCount,
|
|
34
|
+
completedAt,
|
|
35
|
+
phase: 'completed',
|
|
36
|
+
submittedAt,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export function buildFailedStatus(context, error) {
|
|
40
|
+
const completedAt = new Date().toISOString();
|
|
41
|
+
return {
|
|
42
|
+
...buildBaseStatus(context, completedAt),
|
|
43
|
+
completedAt,
|
|
44
|
+
error,
|
|
45
|
+
phase: 'failed',
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=lifecycle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.js","sourceRoot":"","sources":["../../src/lib/lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,IAAI,MAAM,WAAW,CAAC;AAiB7B,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,QAAgB,EAAE,KAAc;IAClE,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACzD,MAAM,SAAS,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC3E,CAAC;AAED,SAAS,eAAe,CAAC,OAAyB,EAAE,SAAiB;IACnE,OAAO;QACL,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,cAAc,EAAE,OAAO,CAAC,cAAc;QACtC,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,SAAS;KACV,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,OAAyB;IAC1D,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAE3C,OAAO;QACL,GAAG,eAAe,CAAC,OAAO,EAAE,SAAS,CAAC;QACtC,KAAK,EAAE,SAAS;KACjB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,OAAyB,EACzB,WAAmB,EACnB,eAAuB;IAEvB,MAAM,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAE7C,OAAO;QACL,GAAG,eAAe,CAAC,OAAO,EAAE,WAAW,CAAC;QACxC,eAAe;QACf,WAAW;QACX,KAAK,EAAE,WAAW;QAClB,WAAW;KACZ,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAyB,EAAE,KAAa;IACxE,MAAM,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAE7C,OAAO;QACL,GAAG,eAAe,CAAC,OAAO,EAAE,WAAW,CAAC;QACxC,WAAW;QACX,KAAK;QACL,KAAK,EAAE,QAAQ;KAChB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface ReviewPromptFile {
|
|
2
|
+
relativePath: string;
|
|
3
|
+
id?: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
absolutePath?: string;
|
|
6
|
+
content?: string;
|
|
7
|
+
lineCount?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface ReviewPromptAnnotation {
|
|
10
|
+
filePath: string;
|
|
11
|
+
annotationId?: string;
|
|
12
|
+
selection: {
|
|
13
|
+
startLine: number;
|
|
14
|
+
endLine: number;
|
|
15
|
+
};
|
|
16
|
+
selectedText: string;
|
|
17
|
+
note: string;
|
|
18
|
+
createdAt?: string;
|
|
19
|
+
updatedAt?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ReviewPromptInput {
|
|
22
|
+
rootPath: string;
|
|
23
|
+
files: ReviewPromptFile[];
|
|
24
|
+
annotations: ReviewPromptAnnotation[];
|
|
25
|
+
}
|
|
26
|
+
export declare function buildReviewPrompt({ rootPath, files, annotations }: ReviewPromptInput): string;
|
|
27
|
+
//# sourceMappingURL=review.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../src/lib/review.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE;QACT,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,WAAW,EAAE,sBAAsB,EAAE,CAAC;CACvC;AAiID,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,iBAAiB,GAAG,MAAM,CAsC7F"}
|