@monoes/monomindcli 2.13.0 → 2.14.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/.claude/skills/monodesign/scripts/context.mjs +1 -1
- package/.claude/skills/monodesign/scripts/detector/detect-antipatterns-browser.js +2 -2
- package/.claude/skills/monodesign/scripts/detector/rules/checks.mjs +2 -2
- package/.claude/skills/monodesign/scripts/live-browser.js +1 -1
- package/bin/cli.js +21 -1
- package/bin/mcp-server.js +21 -1
- package/dist/src/capabilities/cap-documents.d.ts.map +1 -1
- package/dist/src/capabilities/cap-documents.js +23 -0
- package/dist/src/capabilities/cap-documents.js.map +1 -1
- package/dist/src/commands/doc-filters.d.ts +19 -0
- package/dist/src/commands/doc-filters.d.ts.map +1 -0
- package/dist/src/commands/doc-filters.js +58 -0
- package/dist/src/commands/doc-filters.js.map +1 -0
- package/dist/src/commands/doc-library.d.ts +21 -0
- package/dist/src/commands/doc-library.d.ts.map +1 -0
- package/dist/src/commands/doc-library.js +390 -0
- package/dist/src/commands/doc-library.js.map +1 -0
- package/dist/src/commands/doc-list.d.ts +9 -0
- package/dist/src/commands/doc-list.d.ts.map +1 -0
- package/dist/src/commands/doc-list.js +99 -0
- package/dist/src/commands/doc-list.js.map +1 -0
- package/dist/src/commands/doc.d.ts.map +1 -1
- package/dist/src/commands/doc.js +49 -37
- package/dist/src/commands/doc.js.map +1 -1
- package/dist/src/commands/doctor-mcp-probe.d.ts +48 -0
- package/dist/src/commands/doctor-mcp-probe.d.ts.map +1 -0
- package/dist/src/commands/doctor-mcp-probe.js +205 -0
- package/dist/src/commands/doctor-mcp-probe.js.map +1 -0
- package/dist/src/commands/doctor-project-checks.d.ts +12 -1
- package/dist/src/commands/doctor-project-checks.d.ts.map +1 -1
- package/dist/src/commands/doctor-project-checks.js +55 -4
- package/dist/src/commands/doctor-project-checks.js.map +1 -1
- package/dist/src/commands/doctor.d.ts.map +1 -1
- package/dist/src/commands/doctor.js +10 -1
- package/dist/src/commands/doctor.js.map +1 -1
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +17 -0
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/mcp.d.ts.map +1 -1
- package/dist/src/commands/mcp.js +4 -3
- package/dist/src/commands/mcp.js.map +1 -1
- package/dist/src/commands/org-observe.d.ts.map +1 -1
- package/dist/src/commands/org-observe.js +14 -0
- package/dist/src/commands/org-observe.js.map +1 -1
- package/dist/src/commands/org.d.ts.map +1 -1
- package/dist/src/commands/org.js +12 -2
- package/dist/src/commands/org.js.map +1 -1
- package/dist/src/init/claudemd-generator.d.ts.map +1 -1
- package/dist/src/init/claudemd-generator.js +2 -1
- package/dist/src/init/claudemd-generator.js.map +1 -1
- package/dist/src/init/mcp-generator.d.ts.map +1 -1
- package/dist/src/init/mcp-generator.js +3 -3
- package/dist/src/init/mcp-generator.js.map +1 -1
- package/dist/src/init/types.d.ts +6 -0
- package/dist/src/init/types.d.ts.map +1 -1
- package/dist/src/init/types.js.map +1 -1
- package/dist/src/init/write-runtime-config.d.ts.map +1 -1
- package/dist/src/init/write-runtime-config.js +12 -2
- package/dist/src/init/write-runtime-config.js.map +1 -1
- package/dist/src/knowledge/capture-envelope.d.ts +80 -0
- package/dist/src/knowledge/capture-envelope.d.ts.map +1 -0
- package/dist/src/knowledge/capture-envelope.js +165 -0
- package/dist/src/knowledge/capture-envelope.js.map +1 -0
- package/dist/src/knowledge/capture-text.d.ts +23 -0
- package/dist/src/knowledge/capture-text.d.ts.map +1 -0
- package/dist/src/knowledge/capture-text.js +49 -0
- package/dist/src/knowledge/capture-text.js.map +1 -0
- package/dist/src/knowledge/citation.d.ts +121 -0
- package/dist/src/knowledge/citation.d.ts.map +1 -0
- package/dist/src/knowledge/citation.js +252 -0
- package/dist/src/knowledge/citation.js.map +1 -0
- package/dist/src/knowledge/document-pipeline.d.ts +60 -0
- package/dist/src/knowledge/document-pipeline.d.ts.map +1 -1
- package/dist/src/knowledge/document-pipeline.js +188 -4
- package/dist/src/knowledge/document-pipeline.js.map +1 -1
- package/dist/src/knowledge/html-extract.d.ts +43 -0
- package/dist/src/knowledge/html-extract.d.ts.map +1 -0
- package/dist/src/knowledge/html-extract.js +286 -0
- package/dist/src/knowledge/html-extract.js.map +1 -0
- package/dist/src/knowledge/html-tags.d.ts +30 -0
- package/dist/src/knowledge/html-tags.d.ts.map +1 -0
- package/dist/src/knowledge/html-tags.js +229 -0
- package/dist/src/knowledge/html-tags.js.map +1 -0
- package/dist/src/knowledge/library.d.ts +106 -0
- package/dist/src/knowledge/library.d.ts.map +1 -0
- package/dist/src/knowledge/library.js +195 -0
- package/dist/src/knowledge/library.js.map +1 -0
- package/dist/src/knowledge/mhtml.d.ts +60 -0
- package/dist/src/knowledge/mhtml.d.ts.map +1 -0
- package/dist/src/knowledge/mhtml.js +154 -0
- package/dist/src/knowledge/mhtml.js.map +1 -0
- package/dist/src/knowledge/related.d.ts +58 -0
- package/dist/src/knowledge/related.d.ts.map +1 -0
- package/dist/src/knowledge/related.js +222 -0
- package/dist/src/knowledge/related.js.map +1 -0
- package/dist/src/knowledge/section-diff.d.ts +48 -0
- package/dist/src/knowledge/section-diff.d.ts.map +1 -0
- package/dist/src/knowledge/section-diff.js +151 -0
- package/dist/src/knowledge/section-diff.js.map +1 -0
- package/dist/src/knowledge/watch.d.ts +92 -0
- package/dist/src/knowledge/watch.d.ts.map +1 -0
- package/dist/src/knowledge/watch.js +221 -0
- package/dist/src/knowledge/watch.js.map +1 -0
- package/dist/src/mcp-server.d.ts.map +1 -1
- package/dist/src/mcp-server.js +44 -87
- package/dist/src/mcp-server.js.map +1 -1
- package/dist/src/mcp-tools/browser-instrument-tools.d.ts +35 -0
- package/dist/src/mcp-tools/browser-instrument-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/browser-instrument-tools.js +359 -0
- package/dist/src/mcp-tools/browser-instrument-tools.js.map +1 -0
- package/dist/src/mcp-tools/browser-metrics.d.ts +42 -0
- package/dist/src/mcp-tools/browser-metrics.d.ts.map +1 -0
- package/dist/src/mcp-tools/browser-metrics.js +91 -0
- package/dist/src/mcp-tools/browser-metrics.js.map +1 -0
- package/dist/src/mcp-tools/browser-profile-tools.d.ts +16 -0
- package/dist/src/mcp-tools/browser-profile-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/browser-profile-tools.js +324 -0
- package/dist/src/mcp-tools/browser-profile-tools.js.map +1 -0
- package/dist/src/mcp-tools/browser-session.d.ts +68 -0
- package/dist/src/mcp-tools/browser-session.d.ts.map +1 -0
- package/dist/src/mcp-tools/browser-session.js +224 -0
- package/dist/src/mcp-tools/browser-session.js.map +1 -0
- package/dist/src/mcp-tools/browser-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/browser-tools.js +10 -176
- package/dist/src/mcp-tools/browser-tools.js.map +1 -1
- package/dist/src/mcp-tools/capture-resource-read.d.ts +115 -0
- package/dist/src/mcp-tools/capture-resource-read.d.ts.map +1 -0
- package/dist/src/mcp-tools/capture-resource-read.js +296 -0
- package/dist/src/mcp-tools/capture-resource-read.js.map +1 -0
- package/dist/src/mcp-tools/capture-resource-tools.d.ts +22 -0
- package/dist/src/mcp-tools/capture-resource-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/capture-resource-tools.js +182 -0
- package/dist/src/mcp-tools/capture-resource-tools.js.map +1 -0
- package/dist/src/mcp-tools/capture-resources.d.ts +142 -0
- package/dist/src/mcp-tools/capture-resources.d.ts.map +1 -0
- package/dist/src/mcp-tools/capture-resources.js +289 -0
- package/dist/src/mcp-tools/capture-resources.js.map +1 -0
- package/dist/src/mcp-tools/index.d.ts +3 -0
- package/dist/src/mcp-tools/index.d.ts.map +1 -1
- package/dist/src/mcp-tools/index.js +6 -0
- package/dist/src/mcp-tools/index.js.map +1 -1
- package/dist/src/mcp-tools/knowledge-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/knowledge-tools.js +9 -1
- package/dist/src/mcp-tools/knowledge-tools.js.map +1 -1
- package/dist/src/mcp-tools/resource-router.d.ts +86 -0
- package/dist/src/mcp-tools/resource-router.d.ts.map +1 -0
- package/dist/src/mcp-tools/resource-router.js +181 -0
- package/dist/src/mcp-tools/resource-router.js.map +1 -0
- package/dist/src/memory/memory-bridge.js +1 -1
- package/dist/src/memory/memory-bridge.js.map +1 -1
- package/dist/src/orgrt/agent-runner.d.ts +38 -0
- package/dist/src/orgrt/agent-runner.d.ts.map +1 -1
- package/dist/src/orgrt/agent-runner.js +47 -0
- package/dist/src/orgrt/agent-runner.js.map +1 -1
- package/dist/src/orgrt/checkpoint.d.ts +12 -1
- package/dist/src/orgrt/checkpoint.d.ts.map +1 -1
- package/dist/src/orgrt/checkpoint.js +15 -6
- package/dist/src/orgrt/checkpoint.js.map +1 -1
- package/dist/src/orgrt/completion-gate.d.ts +74 -0
- package/dist/src/orgrt/completion-gate.d.ts.map +1 -1
- package/dist/src/orgrt/completion-gate.js +45 -0
- package/dist/src/orgrt/completion-gate.js.map +1 -1
- package/dist/src/orgrt/cost-tier.d.ts +144 -0
- package/dist/src/orgrt/cost-tier.d.ts.map +1 -0
- package/dist/src/orgrt/cost-tier.js +183 -0
- package/dist/src/orgrt/cost-tier.js.map +1 -0
- package/dist/src/orgrt/cross-org.d.ts.map +1 -1
- package/dist/src/orgrt/cross-org.js +14 -0
- package/dist/src/orgrt/cross-org.js.map +1 -1
- package/dist/src/orgrt/daemon.d.ts +12 -1
- package/dist/src/orgrt/daemon.d.ts.map +1 -1
- package/dist/src/orgrt/daemon.js +216 -49
- package/dist/src/orgrt/daemon.js.map +1 -1
- package/dist/src/orgrt/decisions.d.ts +14 -2
- package/dist/src/orgrt/decisions.d.ts.map +1 -1
- package/dist/src/orgrt/decisions.js +216 -10
- package/dist/src/orgrt/decisions.js.map +1 -1
- package/dist/src/orgrt/file-roots.d.ts +7 -0
- package/dist/src/orgrt/file-roots.d.ts.map +1 -1
- package/dist/src/orgrt/file-roots.js +38 -1
- package/dist/src/orgrt/file-roots.js.map +1 -1
- package/dist/src/orgrt/forwarder.d.ts.map +1 -1
- package/dist/src/orgrt/forwarder.js +16 -2
- package/dist/src/orgrt/forwarder.js.map +1 -1
- package/dist/src/orgrt/idle-deadline.d.ts +74 -1
- package/dist/src/orgrt/idle-deadline.d.ts.map +1 -1
- package/dist/src/orgrt/idle-deadline.js +52 -2
- package/dist/src/orgrt/idle-deadline.js.map +1 -1
- package/dist/src/orgrt/loadouts.d.ts +38 -0
- package/dist/src/orgrt/loadouts.d.ts.map +1 -0
- package/dist/src/orgrt/loadouts.js +129 -0
- package/dist/src/orgrt/loadouts.js.map +1 -0
- package/dist/src/orgrt/mailbox.d.ts +17 -1
- package/dist/src/orgrt/mailbox.d.ts.map +1 -1
- package/dist/src/orgrt/mailbox.js +50 -3
- package/dist/src/orgrt/mailbox.js.map +1 -1
- package/dist/src/orgrt/policy.d.ts +42 -2
- package/dist/src/orgrt/policy.d.ts.map +1 -1
- package/dist/src/orgrt/policy.js +53 -8
- package/dist/src/orgrt/policy.js.map +1 -1
- package/dist/src/orgrt/prompt-vars.d.ts +11 -0
- package/dist/src/orgrt/prompt-vars.d.ts.map +1 -0
- package/dist/src/orgrt/prompt-vars.js +49 -0
- package/dist/src/orgrt/prompt-vars.js.map +1 -0
- package/dist/src/orgrt/questions.d.ts +22 -1
- package/dist/src/orgrt/questions.d.ts.map +1 -1
- package/dist/src/orgrt/questions.js +24 -3
- package/dist/src/orgrt/questions.js.map +1 -1
- package/dist/src/orgrt/review-packet.d.ts +29 -0
- package/dist/src/orgrt/review-packet.d.ts.map +1 -0
- package/dist/src/orgrt/review-packet.js +67 -0
- package/dist/src/orgrt/review-packet.js.map +1 -0
- package/dist/src/orgrt/role-sandbox.d.ts.map +1 -1
- package/dist/src/orgrt/role-sandbox.js +16 -3
- package/dist/src/orgrt/role-sandbox.js.map +1 -1
- package/dist/src/orgrt/session-ledger.d.ts +68 -0
- package/dist/src/orgrt/session-ledger.d.ts.map +1 -0
- package/dist/src/orgrt/session-ledger.js +128 -0
- package/dist/src/orgrt/session-ledger.js.map +1 -0
- package/dist/src/orgrt/session.d.ts +45 -5
- package/dist/src/orgrt/session.d.ts.map +1 -1
- package/dist/src/orgrt/session.js +397 -27
- package/dist/src/orgrt/session.js.map +1 -1
- package/dist/src/orgrt/task-dag.d.ts +34 -1
- package/dist/src/orgrt/task-dag.d.ts.map +1 -1
- package/dist/src/orgrt/task-dag.js +58 -7
- package/dist/src/orgrt/task-dag.js.map +1 -1
- package/dist/src/orgrt/tool-spill.d.ts +94 -0
- package/dist/src/orgrt/tool-spill.d.ts.map +1 -0
- package/dist/src/orgrt/tool-spill.js +180 -0
- package/dist/src/orgrt/tool-spill.js.map +1 -0
- package/dist/src/orgrt/types.d.ts +138 -0
- package/dist/src/orgrt/types.d.ts.map +1 -1
- package/dist/src/orgrt/types.js +148 -0
- package/dist/src/orgrt/types.js.map +1 -1
- package/dist/src/platform-adapters/renderers/mcp.d.ts +20 -2
- package/dist/src/platform-adapters/renderers/mcp.d.ts.map +1 -1
- package/dist/src/platform-adapters/renderers/mcp.js +25 -5
- package/dist/src/platform-adapters/renderers/mcp.js.map +1 -1
- package/dist/src/protocol-capabilities.d.ts +2 -1
- package/dist/src/protocol-capabilities.d.ts.map +1 -1
- package/dist/src/protocol-capabilities.js +2 -1
- package/dist/src/protocol-capabilities.js.map +1 -1
- package/dist/src/ui/dashboard.html +450 -164
- package/dist/src/ui/org-hil.mjs +276 -0
- package/dist/src/ui/org-runtime.mjs +350 -0
- package/dist/src/ui/orgs.html +15 -4
- package/dist/src/ui/routes-org.mjs +290 -541
- package/dist/src/ui/server.mjs +25 -5
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -8
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GLU-07 — reading a capture as an MCP resource.
|
|
3
|
+
*
|
|
4
|
+
* A read has one job beyond handing over the text: make the text QUOTABLE.
|
|
5
|
+
* A model that receives 8kB of markdown with no idea where it came from will
|
|
6
|
+
* paraphrase it as its own; the same markdown with the url, the title, the
|
|
7
|
+
* capture time and the version in front of it gets cited. So every read is
|
|
8
|
+
* two parts —
|
|
9
|
+
*
|
|
10
|
+
* contents[0] text/markdown provenance front matter, then the page
|
|
11
|
+
* contents[1] application/json the same provenance, structured, plus
|
|
12
|
+
* chunk spans and citation anchors
|
|
13
|
+
*
|
|
14
|
+
* — and `textStartsAt` says where the front matter ends, so the character
|
|
15
|
+
* offsets in the chunk list still line up with the document itself.
|
|
16
|
+
*
|
|
17
|
+
* `?chunk=` / `?anchor=` read ONE PASSAGE instead, straight through
|
|
18
|
+
* `resolveCitation` (RCL-10): same offsets, same anchor, same W3C text
|
|
19
|
+
* fragment link, and the same `stale: true` when the anchor was cut against a
|
|
20
|
+
* version this page no longer is. This module deliberately owns none of that
|
|
21
|
+
* logic — a second implementation of "which passage is this" is how a citation
|
|
22
|
+
* and its quote drift apart.
|
|
23
|
+
*
|
|
24
|
+
* @module v1/cli/mcp-tools/capture-resource-read
|
|
25
|
+
*/
|
|
26
|
+
import * as crypto from 'node:crypto';
|
|
27
|
+
import * as fs from 'node:fs';
|
|
28
|
+
import * as path from 'node:path';
|
|
29
|
+
import { buildCaptureUri, CAPTURE_JSON_MIME_TYPE, CAPTURE_MIME_TYPE, captureLibraryIndex, captureStoreRoot, isCaptureUri, loadCaptureDocuments, parseCaptureUri, } from './capture-resources.js';
|
|
30
|
+
/** A document longer than this is served truncated: an MCP client pastes the
|
|
31
|
+
* whole resource into a context window, and a 5MB archive would blow it. */
|
|
32
|
+
const MAX_TEXT_CHARS = 200_000;
|
|
33
|
+
/** Chunk spans carried inline. Beyond this the list is cut and says so —
|
|
34
|
+
* `?chunk=` still addresses every one of them. */
|
|
35
|
+
const MAX_CHUNKS = 200;
|
|
36
|
+
// ── Helpers ────────────────────────────────────────────────────────
|
|
37
|
+
function fileEntry(absolutePath) {
|
|
38
|
+
const stat = fs.statSync(absolutePath);
|
|
39
|
+
return {
|
|
40
|
+
path: absolutePath,
|
|
41
|
+
absolutePath,
|
|
42
|
+
extension: path.extname(absolutePath).toLowerCase(),
|
|
43
|
+
size: stat.size,
|
|
44
|
+
modified: stat.mtime,
|
|
45
|
+
created: stat.birthtime,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
const sha256 = (text) => crypto.createHash('sha256').update(text).digest('hex');
|
|
49
|
+
/** YAML-safe scalar: quoted only when it would otherwise be ambiguous. */
|
|
50
|
+
function scalar(value) {
|
|
51
|
+
return /^\s|\s$|[\n\r"']|:\s|^[-?[\]{}#&*!|>%@`]/.test(value) ? JSON.stringify(value) : value;
|
|
52
|
+
}
|
|
53
|
+
function frontMatter(fields) {
|
|
54
|
+
const lines = fields
|
|
55
|
+
.filter(([, v]) => v !== undefined && v !== '')
|
|
56
|
+
.map(([k, v]) => `${k}: ${typeof v === 'number' ? v : scalar(v)}`);
|
|
57
|
+
return `---\n${lines.join('\n')}\n---\n\n`;
|
|
58
|
+
}
|
|
59
|
+
async function readText(filePath) {
|
|
60
|
+
const { extractText } = await import('../capabilities/cap-documents.js');
|
|
61
|
+
if (!fs.existsSync(filePath)) {
|
|
62
|
+
throw new Error(`source file is gone: ${filePath} (re-ingest the capture to read it)`);
|
|
63
|
+
}
|
|
64
|
+
const text = await extractText(fileEntry(filePath));
|
|
65
|
+
if (!text)
|
|
66
|
+
throw new Error(`no text could be extracted from ${filePath}`);
|
|
67
|
+
return text;
|
|
68
|
+
}
|
|
69
|
+
function provenanceOf(record) {
|
|
70
|
+
return record.provenance ?? {};
|
|
71
|
+
}
|
|
72
|
+
function urlOf(record) {
|
|
73
|
+
const prov = provenanceOf(record);
|
|
74
|
+
return record.canonicalUrl ?? prov.canonicalUrl ?? prov.url;
|
|
75
|
+
}
|
|
76
|
+
async function versionsOf(rootDir, identity, scope) {
|
|
77
|
+
const { listDocumentVersions } = await import('../knowledge/document-pipeline.js');
|
|
78
|
+
const seen = new Map();
|
|
79
|
+
for (const record of listDocumentVersions(rootDir, identity, scope)) {
|
|
80
|
+
if (!record.version)
|
|
81
|
+
continue;
|
|
82
|
+
seen.set(record.version, {
|
|
83
|
+
version: record.version,
|
|
84
|
+
uri: buildCaptureUri(scope, identity, { version: record.version }),
|
|
85
|
+
indexedAt: record.indexedAt,
|
|
86
|
+
contentHash: record.contentHash,
|
|
87
|
+
filePath: record.filePath,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return [...seen.values()].sort((a, b) => a.version - b.version);
|
|
91
|
+
}
|
|
92
|
+
// ── Reads ──────────────────────────────────────────────────────────
|
|
93
|
+
/**
|
|
94
|
+
* Read a capture: the whole page, one stored version, or one passage.
|
|
95
|
+
*
|
|
96
|
+
* Throws with a message meant for a human — an unknown page, a file that has
|
|
97
|
+
* been deleted since it was indexed and a chunk that does not exist are all
|
|
98
|
+
* things a caller must see, not silently get an empty document for.
|
|
99
|
+
*/
|
|
100
|
+
export async function readCapture(uri, opts = {}) {
|
|
101
|
+
const parsed = parseCaptureUri(uri);
|
|
102
|
+
if (!parsed)
|
|
103
|
+
throw new Error(`not a capture uri: ${uri}`);
|
|
104
|
+
if (!parsed.identity) {
|
|
105
|
+
throw new Error(`${uri} is a library index, not a document — read it as JSON`);
|
|
106
|
+
}
|
|
107
|
+
if (parsed.version !== undefined && (parsed.chunkIndex !== undefined || parsed.anchor)) {
|
|
108
|
+
throw new Error('a passage read already names its version through the anchor: drop either v= or chunk=/anchor=');
|
|
109
|
+
}
|
|
110
|
+
const { scope, identity } = parsed;
|
|
111
|
+
const rootDir = await captureStoreRoot(scope, opts);
|
|
112
|
+
const { findDocumentRecord } = await import('../knowledge/document-pipeline.js');
|
|
113
|
+
if (parsed.chunkIndex !== undefined || parsed.anchor) {
|
|
114
|
+
return readPassage(uri, parsed.scope, identity, rootDir, {
|
|
115
|
+
...(parsed.chunkIndex !== undefined ? { chunkIndex: parsed.chunkIndex } : {}),
|
|
116
|
+
...(parsed.anchor ? { anchor: parsed.anchor } : {}),
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
let record = findDocumentRecord(rootDir, identity, scope);
|
|
120
|
+
const versions = await versionsOf(rootDir, identity, scope);
|
|
121
|
+
if (parsed.version !== undefined) {
|
|
122
|
+
const wanted = versions.find((v) => v.version === parsed.version);
|
|
123
|
+
if (!wanted) {
|
|
124
|
+
throw new Error(`version ${parsed.version} is not recorded for ${identity}` +
|
|
125
|
+
(versions.length ? ` (have ${versions.map((v) => v.version).join(', ')})` : ''));
|
|
126
|
+
}
|
|
127
|
+
const { listDocumentVersions } = await import('../knowledge/document-pipeline.js');
|
|
128
|
+
record = listDocumentVersions(rootDir, identity, scope).find((m) => m.version === parsed.version);
|
|
129
|
+
}
|
|
130
|
+
if (!record)
|
|
131
|
+
throw new Error(`not indexed: ${identity} (nothing at ${uri})`);
|
|
132
|
+
const text = await readText(record.filePath);
|
|
133
|
+
const contentHash = sha256(text);
|
|
134
|
+
const limit = Math.max(1, opts.maxChars ?? MAX_TEXT_CHARS);
|
|
135
|
+
const body = text.length > limit ? text.slice(0, limit) : text;
|
|
136
|
+
const { chunkSpans } = await import('../knowledge/document-pipeline.js');
|
|
137
|
+
const { citationAnchor } = await import('../knowledge/citation.js');
|
|
138
|
+
const spans = await chunkSpans(text);
|
|
139
|
+
const chunks = spans.slice(0, MAX_CHUNKS).map((span) => ({
|
|
140
|
+
chunkIndex: span.chunkIndex,
|
|
141
|
+
startChar: span.startChar,
|
|
142
|
+
endChar: span.endChar,
|
|
143
|
+
anchor: citationAnchor(contentHash, span.startChar, span.endChar),
|
|
144
|
+
uri: buildCaptureUri(scope, identity, { chunkIndex: span.chunkIndex }),
|
|
145
|
+
}));
|
|
146
|
+
const prov = provenanceOf(record);
|
|
147
|
+
const url = urlOf(record);
|
|
148
|
+
const { documentSite } = await import('../knowledge/library.js');
|
|
149
|
+
const stale = contentHash !== record.contentHash;
|
|
150
|
+
const matter = frontMatter([
|
|
151
|
+
['uri', uri],
|
|
152
|
+
['title', prov.title],
|
|
153
|
+
['url', url],
|
|
154
|
+
['byline', prov.byline],
|
|
155
|
+
['capturedAt', prov.capturedAt],
|
|
156
|
+
['publishedAt', prov.publishedAt],
|
|
157
|
+
['version', record.version],
|
|
158
|
+
['source', prov.source],
|
|
159
|
+
['collection', prov.collection],
|
|
160
|
+
['tags', prov.tags?.join(', ')],
|
|
161
|
+
['contentHash', contentHash.slice(0, 12)],
|
|
162
|
+
['scope', scope],
|
|
163
|
+
['stale', stale ? 'true' : undefined],
|
|
164
|
+
['truncated', text.length > limit ? 'true' : undefined],
|
|
165
|
+
]);
|
|
166
|
+
const info = {
|
|
167
|
+
uri,
|
|
168
|
+
scope,
|
|
169
|
+
filePath: record.filePath,
|
|
170
|
+
...(prov.title ? { title: prov.title } : {}),
|
|
171
|
+
...(url ? { url } : {}),
|
|
172
|
+
...(documentSite(record) ? { site: documentSite(record) } : {}),
|
|
173
|
+
...(prov.capturedAt ? { capturedAt: prov.capturedAt } : {}),
|
|
174
|
+
indexedAt: record.indexedAt,
|
|
175
|
+
...(prov.publishedAt ? { publishedAt: prov.publishedAt } : {}),
|
|
176
|
+
...(prov.byline ? { byline: prov.byline } : {}),
|
|
177
|
+
...(prov.httpStatus !== undefined ? { httpStatus: prov.httpStatus } : {}),
|
|
178
|
+
...(prov.note ? { note: prov.note } : {}),
|
|
179
|
+
...(prov.source ? { source: prov.source } : {}),
|
|
180
|
+
...(prov.collection ? { collection: prov.collection } : {}),
|
|
181
|
+
tags: prov.tags ?? [],
|
|
182
|
+
...(record.version ? { version: record.version } : {}),
|
|
183
|
+
...(versions.length > 1 ? { versions } : {}),
|
|
184
|
+
contentHash,
|
|
185
|
+
indexedContentHash: record.contentHash,
|
|
186
|
+
...(stale ? { stale: true } : {}),
|
|
187
|
+
chunkCount: record.chunkCount,
|
|
188
|
+
size: record.size,
|
|
189
|
+
textChars: text.length,
|
|
190
|
+
...(text.length > limit ? { truncated: true } : {}),
|
|
191
|
+
textStartsAt: matter.length,
|
|
192
|
+
chunks,
|
|
193
|
+
...(spans.length > chunks.length ? { chunksTruncated: true } : {}),
|
|
194
|
+
};
|
|
195
|
+
return { uri, markdown: `${matter}${body}`, info };
|
|
196
|
+
}
|
|
197
|
+
/** One passage, through `resolveCitation` so the quote, the anchor, the link
|
|
198
|
+
* and the staleness verdict are the same ones `monomind doc cite` gives. */
|
|
199
|
+
async function readPassage(uri, scope, identity, rootDir, where) {
|
|
200
|
+
const { resolveCitation } = await import('../knowledge/citation.js');
|
|
201
|
+
const citation = await resolveCitation(identity, { rootDir, scope, ...where });
|
|
202
|
+
const matter = frontMatter([
|
|
203
|
+
['uri', uri],
|
|
204
|
+
['title', citation.title],
|
|
205
|
+
['url', citation.url],
|
|
206
|
+
['capturedAt', citation.capturedAt],
|
|
207
|
+
['version', citation.version],
|
|
208
|
+
['source', citation.source],
|
|
209
|
+
['chunk', citation.chunkIndex],
|
|
210
|
+
['anchor', citation.anchor],
|
|
211
|
+
['citeUrl', citation.citeUrl],
|
|
212
|
+
['scope', citation.scope],
|
|
213
|
+
['stale', citation.stale ? 'true' : undefined],
|
|
214
|
+
]);
|
|
215
|
+
const markdown = `${matter}> ${citation.quote}\n\n${citation.passage}`;
|
|
216
|
+
const prov = citation.provenance ?? {};
|
|
217
|
+
return {
|
|
218
|
+
uri,
|
|
219
|
+
markdown,
|
|
220
|
+
info: {
|
|
221
|
+
uri,
|
|
222
|
+
scope: citation.scope,
|
|
223
|
+
filePath: citation.filePath,
|
|
224
|
+
...(citation.title ? { title: citation.title } : {}),
|
|
225
|
+
...(citation.url ? { url: citation.url } : {}),
|
|
226
|
+
...(citation.capturedAt ? { capturedAt: citation.capturedAt } : {}),
|
|
227
|
+
indexedAt: '',
|
|
228
|
+
...(prov.byline ? { byline: prov.byline } : {}),
|
|
229
|
+
...(citation.source ? { source: citation.source } : {}),
|
|
230
|
+
...(prov.collection ? { collection: prov.collection } : {}),
|
|
231
|
+
tags: prov.tags ?? [],
|
|
232
|
+
...(citation.version ? { version: citation.version } : {}),
|
|
233
|
+
contentHash: citation.contentHash,
|
|
234
|
+
indexedContentHash: citation.contentHash,
|
|
235
|
+
...(citation.stale ? { stale: true } : {}),
|
|
236
|
+
chunkCount: 0,
|
|
237
|
+
size: citation.passage.length,
|
|
238
|
+
textChars: citation.passage.length,
|
|
239
|
+
textStartsAt: matter.length,
|
|
240
|
+
chunks: [],
|
|
241
|
+
chunkIndex: citation.chunkIndex,
|
|
242
|
+
startChar: citation.startChar,
|
|
243
|
+
endChar: citation.endChar,
|
|
244
|
+
anchor: citation.anchor,
|
|
245
|
+
passage: citation.passage,
|
|
246
|
+
quote: citation.quote,
|
|
247
|
+
...(citation.citeUrl ? { citeUrl: citation.citeUrl } : {}),
|
|
248
|
+
},
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* MCP `resources/read` contents for any `capture://` uri: the scope's library
|
|
253
|
+
* index as JSON, or a document as markdown plus its provenance.
|
|
254
|
+
*/
|
|
255
|
+
export async function captureResourceContents(uri, opts = {}) {
|
|
256
|
+
if (!isCaptureUri(uri))
|
|
257
|
+
throw new Error(`not a capture uri: ${uri}`);
|
|
258
|
+
const parsed = parseCaptureUri(uri);
|
|
259
|
+
if (!parsed)
|
|
260
|
+
throw new Error(`malformed capture uri: ${uri}`);
|
|
261
|
+
if (!parsed.identity) {
|
|
262
|
+
const docs = await loadCaptureDocuments(opts);
|
|
263
|
+
const index = captureLibraryIndex(docs, parsed.scope);
|
|
264
|
+
return {
|
|
265
|
+
contents: [{ uri, mimeType: CAPTURE_JSON_MIME_TYPE, text: JSON.stringify(index, null, 2) }],
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
const read = await readCapture(uri, opts);
|
|
269
|
+
return {
|
|
270
|
+
contents: [
|
|
271
|
+
{ uri, mimeType: CAPTURE_MIME_TYPE, text: read.markdown },
|
|
272
|
+
{ uri, mimeType: CAPTURE_JSON_MIME_TYPE, text: JSON.stringify(read.info, null, 2) },
|
|
273
|
+
],
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
/** The uri for a page a caller names by url or path, searching both stores —
|
|
277
|
+
* captures live in the global brain, so a project-only lookup would deny
|
|
278
|
+
* knowing a page the user saved minutes ago. */
|
|
279
|
+
export async function resolveCaptureUri(target, opts = {}) {
|
|
280
|
+
const { findDocumentRecord } = await import('../knowledge/document-pipeline.js');
|
|
281
|
+
const { captureUriFor } = await import('./capture-resources.js');
|
|
282
|
+
const { getGlobalBrainDir, getProjectRoot } = await import('../memory/memory-bridge.js');
|
|
283
|
+
const store = opts.store ?? 'all';
|
|
284
|
+
const roots = [];
|
|
285
|
+
if (store !== 'global')
|
|
286
|
+
roots.push(opts.rootDir ?? getProjectRoot());
|
|
287
|
+
if (store !== 'project')
|
|
288
|
+
roots.push(opts.globalRoot ?? getGlobalBrainDir());
|
|
289
|
+
for (const root of roots) {
|
|
290
|
+
const record = findDocumentRecord(root, target);
|
|
291
|
+
if (record)
|
|
292
|
+
return captureUriFor(record);
|
|
293
|
+
}
|
|
294
|
+
return undefined;
|
|
295
|
+
}
|
|
296
|
+
//# sourceMappingURL=capture-resource-read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture-resource-read.js","sourceRoot":"","sources":["../../../src/mcp-tools/capture-resource-read.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAGlC,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EAEjB,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,oBAAoB,EACpB,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAEhC;6EAC6E;AAC7E,MAAM,cAAc,GAAG,OAAO,CAAC;AAC/B;mDACmD;AACnD,MAAM,UAAU,GAAG,GAAG,CAAC;AAyEvB,sEAAsE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AAC,CAAC,EAAE;SACpF;KACF,CAAC;AACJ,CAAC;AAED;;iDAEiD;AACjD,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,MAAc,EACd,IAAI,GAAwB,EAAE;IAE9B,MAAM,EAAE,kBAAkB,EAAE,GAAG,MAAM,MAAM,CAAC,mCAAmC,CAAC,CAAC;IACjF,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CAAC,wBAAwB,CAAC,CAAC;IACjE,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,MAAM,MAAM,CAAC,4BAA4B,CAAC,CAAC;IACzF,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC;IAClC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,KAAK,KAAK,QAAQ;QAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,cAAc,EAAE,CAAC,CAAC;IACrE,IAAI,KAAK,KAAK,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,iBAAiB,EAAE,CAAC,CAAC;IAC5E,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,MAAM,GAAG,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAChD,IAAI,MAAM;YAAE,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GLU-07 — the tool half of captures-as-resources.
|
|
3
|
+
*
|
|
4
|
+
* Resources are the point (`resource-router.ts`), but two things they cannot
|
|
5
|
+
* do are worth a tool each:
|
|
6
|
+
*
|
|
7
|
+
* - `resources/list` has no filter parameters in the protocol, and a library
|
|
8
|
+
* of thousands of pages needs "from this site, tagged that, since last
|
|
9
|
+
* week" rather than a cursor walk. `knowledge_captures` is that query, and
|
|
10
|
+
* it hands back the resource URI of every hit so the agent can switch to
|
|
11
|
+
* the resource surface for the actual read.
|
|
12
|
+
* - a client that does not implement resources at all still deserves the
|
|
13
|
+
* provenance-carrying read: `knowledge_capture_read`.
|
|
14
|
+
*
|
|
15
|
+
* Both are thin: the work lives in `capture-resources.ts`, `library.ts` and
|
|
16
|
+
* `citation.ts`.
|
|
17
|
+
*
|
|
18
|
+
* @module v1/cli/mcp-tools/capture-resource-tools
|
|
19
|
+
*/
|
|
20
|
+
import type { MCPTool } from './types.js';
|
|
21
|
+
export declare const captureResourceTools: MCPTool[];
|
|
22
|
+
//# sourceMappingURL=capture-resource-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture-resource-tools.d.ts","sourceRoot":"","sources":["../../../src/mcp-tools/capture-resource-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAiB,MAAM,YAAY,CAAC;AAmLzD,eAAO,MAAM,oBAAoB,EAAE,OAAO,EAA8C,CAAC"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GLU-07 — the tool half of captures-as-resources.
|
|
3
|
+
*
|
|
4
|
+
* Resources are the point (`resource-router.ts`), but two things they cannot
|
|
5
|
+
* do are worth a tool each:
|
|
6
|
+
*
|
|
7
|
+
* - `resources/list` has no filter parameters in the protocol, and a library
|
|
8
|
+
* of thousands of pages needs "from this site, tagged that, since last
|
|
9
|
+
* week" rather than a cursor walk. `knowledge_captures` is that query, and
|
|
10
|
+
* it hands back the resource URI of every hit so the agent can switch to
|
|
11
|
+
* the resource surface for the actual read.
|
|
12
|
+
* - a client that does not implement resources at all still deserves the
|
|
13
|
+
* provenance-carrying read: `knowledge_capture_read`.
|
|
14
|
+
*
|
|
15
|
+
* Both are thin: the work lives in `capture-resources.ts`, `library.ts` and
|
|
16
|
+
* `citation.ts`.
|
|
17
|
+
*
|
|
18
|
+
* @module v1/cli/mcp-tools/capture-resource-tools
|
|
19
|
+
*/
|
|
20
|
+
const json = (data, isError = false) => ({
|
|
21
|
+
content: [{ type: 'text', text: JSON.stringify(data) }],
|
|
22
|
+
...(isError ? { isError: true } : {}),
|
|
23
|
+
});
|
|
24
|
+
const fail = (error) => json({ success: false, error }, true);
|
|
25
|
+
/** A repeated string filter, from a string or an array of them. */
|
|
26
|
+
function strList(value) {
|
|
27
|
+
const items = Array.isArray(value) ? value : typeof value === 'string' ? [value] : [];
|
|
28
|
+
const out = items.filter((v) => typeof v === 'string' && v.trim() !== '');
|
|
29
|
+
return out.length ? out : undefined;
|
|
30
|
+
}
|
|
31
|
+
const str = (value) => typeof value === 'string' && value.trim() ? value.trim() : undefined;
|
|
32
|
+
const MAX_TARGET_CHARS = 2048;
|
|
33
|
+
const knowledgeCaptures = {
|
|
34
|
+
name: 'knowledge_captures',
|
|
35
|
+
description: 'Browse captured pages in the second brain (the MCP `capture://` resources), filtered by ' +
|
|
36
|
+
'site, tag, collection, source or capture date. Returns each page with its resource URI, ' +
|
|
37
|
+
'title, URL, capture time and version — read one with knowledge_capture_read or by ' +
|
|
38
|
+
'reading its resource URI directly. Searches both the project store and the personal ' +
|
|
39
|
+
'global brain, which is where browser captures land.',
|
|
40
|
+
category: 'knowledge',
|
|
41
|
+
tags: ['captures', 'library', 'resources', 'second-brain'],
|
|
42
|
+
inputSchema: {
|
|
43
|
+
type: 'object',
|
|
44
|
+
properties: {
|
|
45
|
+
site: {
|
|
46
|
+
type: 'array',
|
|
47
|
+
items: { type: 'string' },
|
|
48
|
+
description: 'Host, or a parent domain of it (example.com matches docs.example.com)',
|
|
49
|
+
},
|
|
50
|
+
tag: { type: 'array', items: { type: 'string' }, description: 'Capture tags (OR)' },
|
|
51
|
+
collection: { type: 'array', items: { type: 'string' }, description: 'Collections (OR)' },
|
|
52
|
+
source: {
|
|
53
|
+
type: 'array',
|
|
54
|
+
items: { type: 'string' },
|
|
55
|
+
description: "'extension' | 'monobrowse' | 'crawl'",
|
|
56
|
+
},
|
|
57
|
+
since: { type: 'string', description: 'ISO date/time, or an age: 7d, 24h, 30m' },
|
|
58
|
+
until: { type: 'string', description: 'ISO date/time, or an age' },
|
|
59
|
+
text: { type: 'string', description: 'Substring over title, URL, path and note' },
|
|
60
|
+
scope: { type: 'string', description: 'Knowledge scope (e.g. global, shared)' },
|
|
61
|
+
store: { type: 'string', description: "'project' | 'global' | 'all' (default: all)" },
|
|
62
|
+
sort: { type: 'string', description: 'captured (default) | indexed | title | path | size' },
|
|
63
|
+
order: { type: 'string', description: "'desc' (default) | 'asc'" },
|
|
64
|
+
limit: { type: 'number', description: 'Page size (default 50, max 200)' },
|
|
65
|
+
cursor: { type: 'string', description: 'nextCursor from a previous call' },
|
|
66
|
+
includeLocal: {
|
|
67
|
+
type: 'boolean',
|
|
68
|
+
description: 'Also list ordinary indexed files, which are not captures',
|
|
69
|
+
},
|
|
70
|
+
facets: { type: 'boolean', description: 'Include site/tag/collection/source counts' },
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
handler: async (input) => {
|
|
74
|
+
try {
|
|
75
|
+
const { listCaptureResources, loadCaptureDocuments, selectCaptureDocuments } = await import('./capture-resources.js');
|
|
76
|
+
const store = str(input.store);
|
|
77
|
+
const docs = await loadCaptureDocuments(store === 'project' || store === 'global' || store === 'all' ? { store } : {});
|
|
78
|
+
const opts = {
|
|
79
|
+
...(strList(input.site) ? { site: strList(input.site) } : {}),
|
|
80
|
+
...(strList(input.tag) ? { tag: strList(input.tag) } : {}),
|
|
81
|
+
...(strList(input.collection) ? { collection: strList(input.collection) } : {}),
|
|
82
|
+
...(strList(input.source) ? { source: strList(input.source) } : {}),
|
|
83
|
+
...(str(input.since) ? { since: str(input.since) } : {}),
|
|
84
|
+
...(str(input.until) ? { until: str(input.until) } : {}),
|
|
85
|
+
...(str(input.text) ? { text: str(input.text) } : {}),
|
|
86
|
+
...(str(input.scope) ? { scope: str(input.scope) } : {}),
|
|
87
|
+
...(str(input.sort) ? { sort: str(input.sort) } : {}),
|
|
88
|
+
...(input.order === 'asc' ? { order: 'asc' } : {}),
|
|
89
|
+
...(typeof input.limit === 'number' ? { pageSize: input.limit } : {}),
|
|
90
|
+
...(str(input.cursor) ? { cursor: str(input.cursor) } : {}),
|
|
91
|
+
...(input.includeLocal === true ? { includeLocal: true } : {}),
|
|
92
|
+
};
|
|
93
|
+
const page = listCaptureResources(docs, opts);
|
|
94
|
+
const body = {
|
|
95
|
+
success: true,
|
|
96
|
+
total: page.total,
|
|
97
|
+
captures: page.rows,
|
|
98
|
+
...(page.nextCursor ? { nextCursor: page.nextCursor } : {}),
|
|
99
|
+
};
|
|
100
|
+
if (input.facets === true) {
|
|
101
|
+
const { libraryFacets } = await import('../knowledge/library.js');
|
|
102
|
+
body.facets = libraryFacets(selectCaptureDocuments(docs, opts));
|
|
103
|
+
}
|
|
104
|
+
return json(body);
|
|
105
|
+
}
|
|
106
|
+
catch (err) {
|
|
107
|
+
return fail(err instanceof Error ? err.message : String(err));
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
const knowledgeCaptureRead = {
|
|
112
|
+
name: 'knowledge_capture_read',
|
|
113
|
+
description: 'Read one captured page with its provenance: the readable Markdown plus url, title, ' +
|
|
114
|
+
'capture time, version and citation anchors, so a quote can be cited. Takes a ' +
|
|
115
|
+
'capture:// resource URI, or the page URL / indexed file path. `chunk` or `anchor` ' +
|
|
116
|
+
'returns one passage with a link that lands on it; a passage or page whose file ' +
|
|
117
|
+
'changed since it was indexed comes back flagged stale.',
|
|
118
|
+
category: 'knowledge',
|
|
119
|
+
tags: ['captures', 'citation', 'provenance', 'second-brain'],
|
|
120
|
+
inputSchema: {
|
|
121
|
+
type: 'object',
|
|
122
|
+
properties: {
|
|
123
|
+
uri: { type: 'string', description: 'capture://<scope>/<percent-encoded url>' },
|
|
124
|
+
url: { type: 'string', description: 'The page URL or indexed file path, instead of a uri' },
|
|
125
|
+
version: { type: 'number', description: 'A stored version (default: the current one)' },
|
|
126
|
+
chunk: { type: 'number', description: 'Return only this chunk, as a citable passage' },
|
|
127
|
+
anchor: { type: 'string', description: 'Citation anchor <hash12>#<start>-<end>' },
|
|
128
|
+
maxChars: { type: 'number', description: 'Truncate the document text (default 200000)' },
|
|
129
|
+
includeText: {
|
|
130
|
+
type: 'boolean',
|
|
131
|
+
description: 'Include the Markdown itself (default true)',
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
handler: async (input) => {
|
|
136
|
+
try {
|
|
137
|
+
const { buildCaptureUri, isCaptureUri, parseCaptureUri } = await import('./capture-resources.js');
|
|
138
|
+
const { readCapture, resolveCaptureUri } = await import('./capture-resource-read.js');
|
|
139
|
+
const rawUri = str(input.uri);
|
|
140
|
+
const target = str(input.url);
|
|
141
|
+
if (!rawUri && !target)
|
|
142
|
+
return fail('pass either uri or url');
|
|
143
|
+
if ((rawUri ?? target ?? '').length > MAX_TARGET_CHARS) {
|
|
144
|
+
return fail(`uri/url is longer than ${MAX_TARGET_CHARS} characters`);
|
|
145
|
+
}
|
|
146
|
+
let uri = rawUri;
|
|
147
|
+
if (!uri) {
|
|
148
|
+
uri = await resolveCaptureUri(target);
|
|
149
|
+
if (!uri)
|
|
150
|
+
return fail(`not indexed: ${target}`);
|
|
151
|
+
}
|
|
152
|
+
else if (!isCaptureUri(uri)) {
|
|
153
|
+
return fail(`not a capture uri: ${uri}`);
|
|
154
|
+
}
|
|
155
|
+
// Extras given as arguments win over anything already in the uri.
|
|
156
|
+
const parsed = parseCaptureUri(uri);
|
|
157
|
+
if (!parsed)
|
|
158
|
+
return fail(`malformed capture uri: ${uri}`);
|
|
159
|
+
const extras = {
|
|
160
|
+
...(typeof input.version === 'number' ? { version: input.version } : {}),
|
|
161
|
+
...(typeof input.chunk === 'number' ? { chunkIndex: input.chunk } : {}),
|
|
162
|
+
...(str(input.anchor) ? { anchor: str(input.anchor) } : {}),
|
|
163
|
+
};
|
|
164
|
+
const finalUri = Object.keys(extras).length
|
|
165
|
+
? buildCaptureUri(parsed.scope, parsed.identity, extras)
|
|
166
|
+
: uri;
|
|
167
|
+
const read = await readCapture(finalUri, {
|
|
168
|
+
...(typeof input.maxChars === 'number' ? { maxChars: input.maxChars } : {}),
|
|
169
|
+
});
|
|
170
|
+
return json({
|
|
171
|
+
success: true,
|
|
172
|
+
...read.info,
|
|
173
|
+
...(input.includeText === false ? {} : { markdown: read.markdown }),
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
catch (err) {
|
|
177
|
+
return fail(err instanceof Error ? err.message : String(err));
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
export const captureResourceTools = [knowledgeCaptures, knowledgeCaptureRead];
|
|
182
|
+
//# sourceMappingURL=capture-resource-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture-resource-tools.js","sourceRoot":"","sources":["../../../src/mcp-tools/capture-resource-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,MAAM,IAAI,GAAG,CAAC,IAAa,EAAE,OAAO,GAAG,KAAK,EAAiB,EAAE,CAAC,CAAC;IAC/D,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;IACvD,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;CACtC,CAAC,CAAC;AAEH,MAAM,IAAI,GAAG,CAAC,KAAa,EAAiB,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,CAAC,CAAC;AAErF,mEAAmE;AACnE,SAAS,OAAO,CAAC,KAAc;IAC7B,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,KAA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