@jcode.labs/ragmir 2.16.2 → 2.17.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 +37 -172
- package/dist/access-log.d.ts +1 -0
- package/dist/access-log.d.ts.map +1 -1
- package/dist/access-log.js +57 -24
- package/dist/access-log.js.map +1 -1
- package/dist/cli.js +15 -1
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts +3 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +4 -4
- package/dist/client.js.map +1 -1
- package/dist/config.js +6 -14
- package/dist/config.js.map +1 -1
- package/dist/context-resources.d.ts +3 -3
- package/dist/context-resources.d.ts.map +1 -1
- package/dist/context-resources.js +13 -4
- package/dist/context-resources.js.map +1 -1
- package/dist/destroy.d.ts.map +1 -1
- package/dist/destroy.js +10 -6
- package/dist/destroy.js.map +1 -1
- package/dist/doctor.d.ts +2 -2
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +11 -3
- package/dist/doctor.js.map +1 -1
- package/dist/embeddings.d.ts +4 -0
- package/dist/embeddings.d.ts.map +1 -1
- package/dist/embeddings.js +68 -9
- package/dist/embeddings.js.map +1 -1
- package/dist/evaluate.d.ts +5 -0
- package/dist/evaluate.d.ts.map +1 -1
- package/dist/evaluate.js +50 -9
- package/dist/evaluate.js.map +1 -1
- package/dist/files.d.ts +3 -10
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +49 -15
- package/dist/files.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/ingest.d.ts +2 -2
- package/dist/ingest.d.ts.map +1 -1
- package/dist/ingest.js +356 -163
- package/dist/ingest.js.map +1 -1
- package/dist/ingestion-state.d.ts +53 -0
- package/dist/ingestion-state.d.ts.map +1 -0
- package/dist/ingestion-state.js +257 -0
- package/dist/ingestion-state.js.map +1 -0
- package/dist/mcp-output.d.ts +14 -0
- package/dist/mcp-output.d.ts.map +1 -1
- package/dist/mcp-output.js +121 -0
- package/dist/mcp-output.js.map +1 -1
- package/dist/mcp.d.ts +8 -0
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +362 -116
- package/dist/mcp.js.map +1 -1
- package/dist/ocr.d.ts.map +1 -1
- package/dist/ocr.js +6 -12
- package/dist/ocr.js.map +1 -1
- package/dist/operation.d.ts.map +1 -1
- package/dist/operation.js +3 -2
- package/dist/operation.js.map +1 -1
- package/dist/parsing.d.ts +1 -0
- package/dist/parsing.d.ts.map +1 -1
- package/dist/parsing.js +86 -27
- package/dist/parsing.js.map +1 -1
- package/dist/project-config-file.d.ts +11 -0
- package/dist/project-config-file.d.ts.map +1 -0
- package/dist/project-config-file.js +55 -0
- package/dist/project-config-file.js.map +1 -0
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +12 -4
- package/dist/query.js.map +1 -1
- package/dist/research.d.ts.map +1 -1
- package/dist/research.js +3 -2
- package/dist/research.js.map +1 -1
- package/dist/security.d.ts +2 -2
- package/dist/security.d.ts.map +1 -1
- package/dist/security.js +57 -21
- package/dist/security.js.map +1 -1
- package/dist/semantic-config.d.ts.map +1 -1
- package/dist/semantic-config.js +16 -20
- package/dist/semantic-config.js.map +1 -1
- package/dist/skill.d.ts +2 -13
- package/dist/skill.d.ts.map +1 -1
- package/dist/skill.js.map +1 -1
- package/dist/sources.d.ts.map +1 -1
- package/dist/sources.js +24 -40
- package/dist/sources.js.map +1 -1
- package/dist/store.d.ts +5 -0
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +45 -13
- package/dist/store.js.map +1 -1
- package/dist/types.d.ts +39 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +7 -6
- package/skills/ragmir/SKILL.md +5 -3
- package/skills/ragmir-audio-summary/listening-style.md +11 -11
- package/skills/ragmir-audio-summary/narration-templates.md +22 -22
- package/skills/ragmir-audio-summary/split-lines.py +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jcode.labs/ragmir",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.17.1",
|
|
4
4
|
"description": "Confidential local RAG for coding agents, with offline cited retrieval through CLI, MCP, and TypeScript.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
"zod": "^4.1.13"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
|
-
"@jcode.labs/ragmir-
|
|
81
|
-
"@jcode.labs/ragmir-
|
|
80
|
+
"@jcode.labs/ragmir-chat": "2.17.1",
|
|
81
|
+
"@jcode.labs/ragmir-tts": "2.17.1"
|
|
82
82
|
},
|
|
83
83
|
"peerDependenciesMeta": {
|
|
84
84
|
"@jcode.labs/ragmir-chat": {
|
|
@@ -94,14 +94,15 @@
|
|
|
94
94
|
"publint": "^0.3.21",
|
|
95
95
|
"typescript": "^5.9.3",
|
|
96
96
|
"vitest": "^4.0.15",
|
|
97
|
-
"@jcode.labs/ragmir-chat": "2.
|
|
98
|
-
"@jcode.labs/ragmir-tts": "2.
|
|
97
|
+
"@jcode.labs/ragmir-chat": "2.17.1",
|
|
98
|
+
"@jcode.labs/ragmir-tts": "2.17.1"
|
|
99
99
|
},
|
|
100
100
|
"scripts": {
|
|
101
101
|
"build": "tsc -p tsconfig.json",
|
|
102
102
|
"check": "pnpm --filter @jcode.labs/ragmir-tts build && pnpm --filter @jcode.labs/ragmir-chat build && tsc -p tsconfig.json --noEmit",
|
|
103
103
|
"mcp:smoke": "pnpm build && node scripts/mcp-smoke.mjs",
|
|
104
104
|
"package:check": "publint",
|
|
105
|
-
"test": "pnpm --filter @jcode.labs/ragmir-tts build && pnpm --filter @jcode.labs/ragmir-chat build && vitest run"
|
|
105
|
+
"test": "pnpm --filter @jcode.labs/ragmir-tts build && pnpm --filter @jcode.labs/ragmir-chat build && vitest run",
|
|
106
|
+
"test:coverage": "pnpm --filter @jcode.labs/ragmir-tts build && pnpm --filter @jcode.labs/ragmir-chat build && vitest run --coverage"
|
|
106
107
|
}
|
|
107
108
|
}
|
package/skills/ragmir/SKILL.md
CHANGED
|
@@ -125,9 +125,11 @@ When a client cannot set `cwd`, set `RAGMIR_PROJECT_ROOT` for the server process
|
|
|
125
125
|
when available. Use CLI commands when they are not.
|
|
126
126
|
|
|
127
127
|
Prefer compact search, ask, or research output first. Call `ragmir_expand` with a returned citation
|
|
128
|
-
only when the exact chunk or neighboring context is needed.
|
|
129
|
-
|
|
130
|
-
|
|
128
|
+
only when the exact chunk or neighboring context is needed. Search, ask, research, expansion, audit,
|
|
129
|
+
and evaluation accept `maxBytes`. Variable-size tool and resource JSON is bounded by the configured
|
|
130
|
+
`mcpMaxOutputBytes` and an absolute 1 MiB server ceiling. Inspect `_meta["ragmir/output"]` to see
|
|
131
|
+
whether the response was compacted or truncated. Pass `ragmir_evaluate` an existing
|
|
132
|
+
project-relative golden file; absolute paths and paths outside the base are rejected.
|
|
131
133
|
|
|
132
134
|
When MCP resources are supported, read `ragmir://context` first for a bounded identity, readiness,
|
|
133
135
|
freshness, coverage, and capability overview. Read `ragmir://sources` only when source coverage or
|
|
@@ -38,15 +38,15 @@ If the relevant material does not fill the budget, stop earlier. Padding makes a
|
|
|
38
38
|
|
|
39
39
|
Punctuation is the only cue a TTS engine has for pausing. Use it deliberately.
|
|
40
40
|
|
|
41
|
-
- **Comma**
|
|
42
|
-
- **Period**
|
|
43
|
-
- **Ellipsis**
|
|
41
|
+
- **Comma** `,`: short micro-pause. Use it to separate clauses and ease breathing points.
|
|
42
|
+
- **Period** `.`: full pause. End sentences here. Favour periods over commas when in doubt.
|
|
43
|
+
- **Ellipsis** `…`: deliberate longer pause. Use it before the answer in an active-recall question,
|
|
44
44
|
so the listener gets a beat to think (about three seconds).
|
|
45
|
-
- **Colon**
|
|
45
|
+
- **Colon** `:`: read as a mild pause; acceptable when introducing a short enumeration spoken as
|
|
46
46
|
prose, but prefer rephrasing into a plain sentence.
|
|
47
|
-
- **Semicolon**
|
|
48
|
-
- **Exclamation**
|
|
49
|
-
- **Question mark**
|
|
47
|
+
- **Semicolon** `;`: avoid. Engines hesitate inconsistently. Split into two sentences.
|
|
48
|
+
- **Exclamation** `!`: avoid for TTS. It can trigger an unnatural spike in pitch.
|
|
49
|
+
- **Question mark** `?`: use it for the active-recall questions; the engine raises intonation
|
|
50
50
|
naturally.
|
|
51
51
|
|
|
52
52
|
## Pronounceability
|
|
@@ -56,7 +56,7 @@ Anything the engine might misread must be rewritten for the ear.
|
|
|
56
56
|
- **Acronyms**: expand on first use, then use the short form if it is pronounceable. "Le RGPD, le
|
|
57
57
|
Règlement Général sur la Protection des Données, ..."
|
|
58
58
|
- **Numbers**: write them the way they should be read. "1500" can read as "mille cinq cents" or
|
|
59
|
-
"quinze cents"
|
|
59
|
+
"quinze cents". Write the intended form. For money, spell the currency: "douze mille euros".
|
|
60
60
|
- **Symbols**: rewrite in words. `&` becomes "et", `%` becomes "pour cent", `->` becomes "mène à".
|
|
61
61
|
- **Dates and times**: write them fully. "Le quinze mars deux mille vingt-cinq", not "2025-03-15".
|
|
62
62
|
- **URLs, paths, code**: never read them aloud. Paraphrase: "le fichier de configuration du
|
|
@@ -65,7 +65,7 @@ Anything the engine might misread must be rewritten for the ear.
|
|
|
65
65
|
|
|
66
66
|
## Anti-Patterns
|
|
67
67
|
|
|
68
|
-
Avoid these
|
|
68
|
+
Avoid these. They are the main causes of "imbuvable" audio.
|
|
69
69
|
|
|
70
70
|
- **Jargon without setup.** If a technical term is needed, define it in one short clause first.
|
|
71
71
|
- **Spoken bullet lists.** Enumerations read aloud are exhausting. Convert lists into flowing
|
|
@@ -79,8 +79,8 @@ Avoid these — they are the main causes of "imbuvable" audio.
|
|
|
79
79
|
|
|
80
80
|
## Language
|
|
81
81
|
|
|
82
|
-
- Write the narration in the same language passed to `--lang` (`fr` default
|
|
83
|
-
`zh`).
|
|
82
|
+
- Write the narration in the same language passed to `--lang` (`fr` by default; `en`, `es`, `ja`,
|
|
83
|
+
`th`, and `zh` are also supported).
|
|
84
84
|
- Match the working language the user used when asking for the summary when it is one of the
|
|
85
85
|
supported languages.
|
|
86
86
|
- Keep numerals, units, and proper nouns pronounceable in the target language.
|
|
@@ -6,7 +6,7 @@ tables, SSML, or XML tags. The skeletons below only shape how you order and conn
|
|
|
6
6
|
write the spoken text.
|
|
7
7
|
|
|
8
8
|
Pick the format chosen in the skill, then fill the skeleton with the evidence that serves the user's
|
|
9
|
-
intent. Drop anything that does not serve the intent
|
|
9
|
+
intent. Drop anything that does not serve the intent. That is how you avoid superfluous data.
|
|
10
10
|
|
|
11
11
|
## Format Selection Recap
|
|
12
12
|
|
|
@@ -24,11 +24,11 @@ Length follows relevant material. Never pad.
|
|
|
24
24
|
|
|
25
25
|
Spoken-prose shape (write it as one flowing passage, not as headings):
|
|
26
26
|
|
|
27
|
-
1. **Hook + intent
|
|
28
|
-
2. **Key idea
|
|
29
|
-
3. **Evidence
|
|
30
|
-
4. **Uncertainty / caveat
|
|
31
|
-
5. **Recap + recall
|
|
27
|
+
1. **Hook + intent**: one sentence naming the subject and why the listener asked.
|
|
28
|
+
2. **Key idea**: the single thing to remember, stated up front (primacy).
|
|
29
|
+
3. **Evidence**: one short, plain-language reason or fact that supports it.
|
|
30
|
+
4. **Uncertainty / caveat**: one sentence if the evidence is partial or stale; omit only if solid.
|
|
31
|
+
5. **Recap + recall**: restate the key idea in other words, then ask one active-recall question,
|
|
32
32
|
pause with `…`, and give the answer.
|
|
33
33
|
|
|
34
34
|
Abstract example (do not copy the words, follow the shape):
|
|
@@ -46,16 +46,16 @@ Abstract example (do not copy the words, follow the shape):
|
|
|
46
46
|
The standard brief follows Barbara Minto's pyramid: answer first, then supporting points, then
|
|
47
47
|
recap. Wrap it in a short Situation-Complication-Question-Answer opening.
|
|
48
48
|
|
|
49
|
-
1. **Situation
|
|
50
|
-
2. **Complication
|
|
51
|
-
3. **Question
|
|
52
|
-
4. **Answer (the key message)
|
|
53
|
-
5. **Developed points
|
|
49
|
+
1. **Situation**: one or two sentences framing the context the listener already shares.
|
|
50
|
+
2. **Complication**: the tension, change, or question that prompted the summary.
|
|
51
|
+
3. **Question**: the explicit question the summary answers.
|
|
52
|
+
4. **Answer (the key message)**: the one-to-three points to retain, stated first (primacy).
|
|
53
|
+
5. **Developed points**: each of the two-to-four points expanded in plain speech, grouped with
|
|
54
54
|
signposting ("D'abord…, Ensuite…, Enfin…"). Proven facts only; separate from inference.
|
|
55
|
-
6. **Uncertainty, risks, decisions, missing documents
|
|
55
|
+
6. **Uncertainty, risks, decisions, missing documents**: a short passage on what is not yet
|
|
56
56
|
settled or needs action.
|
|
57
|
-
7. **Recap
|
|
58
|
-
8. **Active recall
|
|
57
|
+
7. **Recap**: restate the two-to-four key points in compressed form (recency).
|
|
58
|
+
8. **Active recall**: two or three recall questions, each followed by a `…` pause and the answer.
|
|
59
59
|
|
|
60
60
|
Abstract example (shape only):
|
|
61
61
|
|
|
@@ -75,17 +75,17 @@ Abstract example (shape only):
|
|
|
75
75
|
Use only when the material genuinely has several distinct facets. Each chapter is a self-contained
|
|
76
76
|
mini-brief with its own mini-recap, so a listener can step away and come back.
|
|
77
77
|
|
|
78
|
-
1. **Promise
|
|
78
|
+
1. **Promise**: what the whole audio covers and the three-to-five landmarks to listen for. State
|
|
79
79
|
the key message of the whole dossier up front.
|
|
80
|
-
2. **Chapter 1
|
|
80
|
+
2. **Chapter 1**: signpost the chapter ("Premier point: …"). Give its mini pyramid
|
|
81
81
|
(answer → evidence → caveat), then a one-sentence mini-recap.
|
|
82
|
-
3. **Chapter 2
|
|
82
|
+
3. **Chapter 2**: same shape, explicit transition ("Deuxième point: …").
|
|
83
83
|
4. **Continue** for each facet. Keep chapters balanced in length; merge thin ones.
|
|
84
|
-
5. **Global recap
|
|
85
|
-
6. **Active recall
|
|
84
|
+
5. **Global recap**: compress the key message of every chapter into one flowing passage (recency).
|
|
85
|
+
6. **Active recall**: three to five recall questions across the chapters, each with a `…` pause
|
|
86
86
|
and the answer. Spread the questions across chapters, not only the last one.
|
|
87
87
|
|
|
88
|
-
Transitions between chapters are essential in long audio
|
|
88
|
+
Transitions between chapters are essential in long audio. See the signposting catalogue below.
|
|
89
89
|
|
|
90
90
|
Abstract shape:
|
|
91
91
|
|
|
@@ -117,7 +117,7 @@ transitions instead of lists or headings.
|
|
|
117
117
|
| Recall question | "Question: …? … [answer]" |
|
|
118
118
|
|
|
119
119
|
When enumerating, say the count first ("trois points") then speak each one with "D'abord / Ensuite /
|
|
120
|
-
Enfin"
|
|
120
|
+
Enfin". Never read a literal list.
|
|
121
121
|
|
|
122
122
|
---
|
|
123
123
|
|
|
@@ -144,7 +144,7 @@ choice, no "est-ce que c'est X?" with the answer embedded).
|
|
|
144
144
|
- After the question mark, insert `…` so the TTS pause gives the listener a beat to answer silently,
|
|
145
145
|
then state the answer in the fewest words possible.
|
|
146
146
|
- Do not reveal the answer inside the question. "Le préavis est-il de trente jours?" leaks the
|
|
147
|
-
answer
|
|
147
|
+
answer. Prefer "Quelle est la durée du préavis?".
|
|
148
148
|
|
|
149
149
|
---
|
|
150
150
|
|
|
@@ -5,7 +5,8 @@ Used to render long narrations sentence-by-sentence when an engine benefits from
|
|
|
5
5
|
import re
|
|
6
6
|
import sys
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
with open(sys.argv[1], encoding="utf-8") as source:
|
|
9
|
+
raw = source.read()
|
|
9
10
|
text = re.sub(r"\s+", " ", raw).strip()
|
|
10
11
|
for part in re.split(r"(?<=[.!?…])\s+", text):
|
|
11
12
|
part = part.strip()
|