dsh-plugin-wiki-tools 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/index.js +15 -2
- package/lib/vault.js +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -76,7 +76,7 @@ export function createTools(vault, options = {}) {
|
|
|
76
76
|
},
|
|
77
77
|
render: (_args, value) => [{
|
|
78
78
|
type: 'text',
|
|
79
|
-
text: renderQueryResult(value)
|
|
79
|
+
text: `${renderVaultRoot(vault.root)}\n\n${renderQueryResult(value)}`,
|
|
80
80
|
}],
|
|
81
81
|
},
|
|
82
82
|
async execute(args) {
|
|
@@ -95,7 +95,9 @@ export function createTools(vault, options = {}) {
|
|
|
95
95
|
description:
|
|
96
96
|
'Write or update one wiki page with full bookkeeping: routes the page to its type folder, '
|
|
97
97
|
+ 'completes YAML frontmatter (type, title, status, created, updated, tags), guards filename '
|
|
98
|
-
+ 'uniqueness, updates the master index entry, and prepends a log entry.
|
|
98
|
+
+ 'uniqueness, updates the master index entry, and prepends a log entry. Writes go to the '
|
|
99
|
+
+ 'CONFIGURED VAULT (run wiki_query to see its absolute root), not the session workspace. '
|
|
100
|
+
+ 'The content is the '
|
|
99
101
|
+ 'markdown body only — frontmatter is managed. With source_path, records the source hash in '
|
|
100
102
|
+ 'the ingest manifest and reports already_ingested for unchanged content unless force is set.',
|
|
101
103
|
parameters: {
|
|
@@ -191,6 +193,17 @@ export function createTools(vault, options = {}) {
|
|
|
191
193
|
return [wikiQuery, wikiWrite, wikiLint]
|
|
192
194
|
}
|
|
193
195
|
|
|
196
|
+
/**
|
|
197
|
+
* Render a compact byline disclosing the vault root. Without it, a model whose
|
|
198
|
+
* session workspace differs from the vault resolves `.raw/…` against the
|
|
199
|
+
* workspace and concludes the tools point somewhere else.
|
|
200
|
+
* @param {string} root - absolute vault root.
|
|
201
|
+
* @returns {string} the byline.
|
|
202
|
+
*/
|
|
203
|
+
function renderVaultRoot(root) {
|
|
204
|
+
return `wiki vault: ${root} — every wiki tool (query, write, lint) operates on this configured vault, not the session workspace. Resolve vault-relative paths like .raw/… and wiki/… against this root.`
|
|
205
|
+
}
|
|
206
|
+
|
|
194
207
|
/**
|
|
195
208
|
* Render a wiki_query result as the model-facing text. The render output is the
|
|
196
209
|
* ONLY content the model sees, so it carries the full payload — hot cache and
|
package/lib/vault.js
CHANGED
|
@@ -279,7 +279,7 @@ export class Vault {
|
|
|
279
279
|
*/
|
|
280
280
|
async trackSource({ sourcePath, pagesCreated = [], pagesUpdated = [] }) {
|
|
281
281
|
const absolute = isAbsolute(sourcePath) ? sourcePath : join(this.root, sourcePath)
|
|
282
|
-
const rel = relative(this.root, absolute)
|
|
282
|
+
const rel = relative(this.root, absolute).split(sep).join('/')
|
|
283
283
|
const raw = await readFile(absolute).catch(error => {
|
|
284
284
|
if (error.code === 'ENOENT') throw new Error(`wiki-tools: source ${sourcePath} not found under the vault`)
|
|
285
285
|
throw error
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-wiki-tools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Native DeepSeek Harness tools for an Obsidian wiki vault: wiki_query, wiki_write, and wiki_lint implement the mechanical core (path routing, delta tracking, index/log bookkeeping, health checks) of the wiki skill suite.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|