dravoice 0.1.2 → 0.1.3
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/LICENSE +21 -21
- package/README.md +102 -36
- package/bin/dravoice.js +11 -10
- package/package.json +47 -45
- package/src/index.js +874 -197
- package/src/v2/analyzers/discourse.js +63 -63
- package/src/v2/analyzers/evidence.js +82 -82
- package/src/v2/analyzers/lexical.js +114 -114
- package/src/v2/analyzers/register.js +46 -34
- package/src/v2/analyzers/rhetorical-shape.js +59 -59
- package/src/v2/analyzers/rhythm.js +39 -47
- package/src/v2/analyzers/structure.js +24 -24
- package/src/v2/benchmark.js +574 -568
- package/src/v2/brief.js +154 -146
- package/src/v2/config.js +78 -0
- package/src/v2/document-model.js +351 -260
- package/src/v2/inspect.js +67 -67
- package/src/v2/io-utils.js +51 -0
- package/src/v2/profile.js +227 -203
- package/src/v2/prompt.js +65 -64
- package/src/v2/review.js +177 -173
- package/src/v2/revise-plan.js +437 -433
- package/src/v2/stylometry.js +342 -332
- package/src/v2/text-utils.js +123 -123
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Dravoice contributors
|
|
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.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dravoice contributors
|
|
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
CHANGED
|
@@ -1,37 +1,103 @@
|
|
|
1
|
-
# Dravoice
|
|
2
|
-
|
|
3
|
-
Dravoice is a local-first CLI for compiling Markdown, MDX, and plain-text
|
|
4
|
-
writing corpora into reusable voice guidance and deterministic draft review
|
|
5
|
-
notes.
|
|
6
|
-
|
|
7
|
-
It is not an AI-authorship detector, grammar checker, prose linter, or
|
|
8
|
-
third-party author imitation tool. It helps a writer inspect and reuse their
|
|
9
|
-
own measurable rhythm, register, evidence habits, discourse shape, and
|
|
10
|
-
structure.
|
|
11
|
-
|
|
12
|
-
##
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
# Dravoice
|
|
2
|
+
|
|
3
|
+
Dravoice is a local-first CLI for compiling Markdown, MDX, and plain-text
|
|
4
|
+
writing corpora into reusable voice guidance and deterministic draft review
|
|
5
|
+
notes.
|
|
6
|
+
|
|
7
|
+
It is not an AI-authorship detector, grammar checker, prose linter, or
|
|
8
|
+
third-party author imitation tool. It helps a writer inspect and reuse their
|
|
9
|
+
own measurable rhythm, register, evidence habits, discourse shape, and
|
|
10
|
+
structure.
|
|
11
|
+
|
|
12
|
+
## First Successful Run
|
|
13
|
+
|
|
14
|
+
Start with your own writing, not a blank prompt. Create an `articles`
|
|
15
|
+
directory in the folder where you want to run Dravoice, then copy in at least
|
|
16
|
+
3 representative long-form Markdown, MDX, or plain-text pieces.
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
mkdir -p articles
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Your first folder should look like this:
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
your-writing-folder/
|
|
26
|
+
articles/
|
|
27
|
+
first-piece.md
|
|
28
|
+
second-piece.mdx
|
|
29
|
+
third-piece.txt
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`./articles` means "the `articles` directory inside my current terminal
|
|
33
|
+
folder." Five to ten pieces gives Dravoice a stronger profile. If
|
|
34
|
+
`./articles` is missing, interactive `init` can look for common writing folders
|
|
35
|
+
such as `./content`, `./posts`, `./blog`, and `./essays`, then preview the
|
|
36
|
+
files before it learns from them.
|
|
37
|
+
|
|
38
|
+
If your writing is already somewhere else, point Dravoice at that directory:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npx dravoice init --examples ~/writing
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 1. Initialize and Inspect
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npx dravoice init
|
|
48
|
+
npx dravoice inspect
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Inspect the profile before trusting it. If the feature-family summaries do not
|
|
52
|
+
look recognizable, improve the source corpus first.
|
|
53
|
+
|
|
54
|
+
### 2. Generate Guidance and a Brief
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npx dravoice prompt --out AGENTS.md
|
|
58
|
+
npx dravoice brief "A new article topic" --evidence notes.md --out brief.md
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Use the generated guidance and evidence-first brief to draft from claims you can
|
|
62
|
+
actually support.
|
|
63
|
+
|
|
64
|
+
### 3. Revise and Review
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npx dravoice revise-plan draft.md
|
|
68
|
+
npx dravoice review draft.md
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
`init` reads your source pieces, writes a local profile in `./dravoice-voice`,
|
|
72
|
+
and writes `.dravoice.yml` project defaults. `inspect` makes the learned
|
|
73
|
+
feature families visible, `prompt` turns high-confidence observations into
|
|
74
|
+
drafting guidance, `brief` creates an evidence-first article plan,
|
|
75
|
+
`revise-plan` ranks calibrated stylometric revision actions, and `review`
|
|
28
76
|
reports family-level drift.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
77
|
+
|
|
78
|
+
Run `drav help init` or `drav help review` for command-specific help.
|
|
79
|
+
|
|
80
|
+
## Advanced Automation
|
|
81
|
+
|
|
82
|
+
Use strict JSON output when CI or local automation should fail on drift:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
npx dravoice review draft.md --mode strict --format json
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Benchmark commands are for validating Dravoice itself, not for a first writer
|
|
89
|
+
workflow:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
npx dravoice benchmark prepare --examples ./articles --topic "A new article topic" --out ./bench-run --seed 42
|
|
93
|
+
npx dravoice benchmark score --run ./bench-run --judge ./bench-run/judge/judgment.json
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Fresh Install Smoke Test
|
|
97
|
+
|
|
98
|
+
From a packed tarball:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
npm pack --json
|
|
102
|
+
node -e "const { execFileSync } = require('node:child_process'); const pack = require('./package.json'); const tarball = './' + pack.name + '-' + pack.version + '.tgz'; execFileSync('npm', ['exec', '--package', tarball, '--', 'drav', '--help'], { stdio: 'inherit' });"
|
|
103
|
+
```
|
package/bin/dravoice.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { runCli } from "../src/index.js";
|
|
3
|
-
|
|
4
|
-
const code = await runCli(process.argv.slice(2), {
|
|
5
|
-
cwd: process.cwd(),
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { runCli } from "../src/index.js";
|
|
3
|
+
|
|
4
|
+
const code = await runCli(process.argv.slice(2), {
|
|
5
|
+
cwd: process.cwd(),
|
|
6
|
+
stdin: process.stdin,
|
|
7
|
+
stdout: process.stdout,
|
|
8
|
+
stderr: process.stderr,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
process.exitCode = code;
|
package/package.json
CHANGED
|
@@ -1,45 +1,47 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dravoice",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Compile article voice profiles into reusable LLM writing context, evidence-first briefs, and deterministic draft review notes.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "dravoice",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "Compile article voice profiles into reusable LLM writing context, evidence-first briefs, and deterministic draft review notes.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"dravoice": "bin/dravoice.js",
|
|
8
|
+
"drav": "bin/dravoice.js"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": "./src/index.js"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"bin/",
|
|
15
|
+
"src/",
|
|
16
|
+
"README.md",
|
|
17
|
+
"LICENSE"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"lint": "node ../../scripts/check-js-syntax.js bin src test",
|
|
21
|
+
"test": "node --test test/v2.test.js",
|
|
22
|
+
"prepublishOnly": "npm run lint && npm run test"
|
|
23
|
+
},
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=18"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"voice",
|
|
29
|
+
"writing",
|
|
30
|
+
"cli",
|
|
31
|
+
"llm",
|
|
32
|
+
"markdown"
|
|
33
|
+
],
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "git+https://github.com/hilmimuktitama/dravoice.git",
|
|
37
|
+
"directory": "packages/js-cli"
|
|
38
|
+
},
|
|
39
|
+
"bugs": {
|
|
40
|
+
"url": "https://github.com/hilmimuktitama/dravoice/issues"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://github.com/hilmimuktitama/dravoice#readme",
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public"
|
|
45
|
+
},
|
|
46
|
+
"license": "MIT"
|
|
47
|
+
}
|