zam-core 0.14.0 → 0.15.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/dist/cli/app.js +25 -2
- package/dist/cli/app.js.map +1 -1
- package/dist/cli/commands/mcp.js +149 -12
- package/dist/cli/commands/mcp.js.map +1 -1
- package/dist/copilot-extension/extension.mjs +1 -0
- package/dist/copilot-extension/host.bundle.js +1 -1
- package/dist/copilot-extension/manifest.json +1 -1
- package/dist/copilot-extension/mcp-client.bundle.mjs +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/ui/graph-panel.html +80 -40
- package/dist/ui/okf-panel.html +26 -1
- package/dist/vscode-extension/ZAM_Companion_0.15.0.vsix +0 -0
- package/dist/vscode-extension/extension.cjs +15 -14
- package/dist/vscode-extension/host.bundle.js +3 -2
- package/dist/vscode-extension/manifest.json +2 -2
- package/package.json +1 -1
- package/dist/vscode-extension/ZAM_Companion_0.14.0.vsix +0 -0
package/dist/cli/app.js
CHANGED
|
@@ -2140,6 +2140,15 @@ async function listTokens(db, options) {
|
|
|
2140
2140
|
)`);
|
|
2141
2141
|
params.push(options.knowledgeContext);
|
|
2142
2142
|
}
|
|
2143
|
+
if (options?.sourceLinkBases) {
|
|
2144
|
+
const clauses = options.sourceLinkBases.map(
|
|
2145
|
+
() => `(source_link = ? OR source_link LIKE ? || '#%' ESCAPE '\\')`
|
|
2146
|
+
);
|
|
2147
|
+
whereClauses.push(clauses.length ? `(${clauses.join(" OR ")})` : "0 = 1");
|
|
2148
|
+
for (const base of options.sourceLinkBases) {
|
|
2149
|
+
params.push(base, escapeLike(base));
|
|
2150
|
+
}
|
|
2151
|
+
}
|
|
2143
2152
|
const orderBy = options?.domain || options?.domainPrefix ? "ORDER BY bloom_level, slug" : "ORDER BY bloom_level, domain, slug";
|
|
2144
2153
|
const sql = `SELECT * FROM tokens WHERE ${whereClauses.join(" AND ")} ${orderBy}`;
|
|
2145
2154
|
const tokens = await db.prepare(sql).all(...params);
|
|
@@ -7501,6 +7510,7 @@ var init_bundle = __esm({
|
|
|
7501
7510
|
var io_exports = {};
|
|
7502
7511
|
__export(io_exports, {
|
|
7503
7512
|
DEFAULT_BUNDLE_DIR: () => DEFAULT_BUNDLE_DIR,
|
|
7513
|
+
collectSourceLinkBases: () => collectSourceLinkBases,
|
|
7504
7514
|
findRepoRoot: () => findRepoRoot,
|
|
7505
7515
|
loadBundle: () => loadBundle,
|
|
7506
7516
|
resolveArticlePath: () => resolveArticlePath,
|
|
@@ -7529,6 +7539,12 @@ function resolveBundleDirFromRoots(rootUris, fallback) {
|
|
|
7529
7539
|
}
|
|
7530
7540
|
return dirs.find((dir) => existsSync18(dir)) ?? dirs[0] ?? fallback;
|
|
7531
7541
|
}
|
|
7542
|
+
function collectSourceLinkBases(dir) {
|
|
7543
|
+
const bundle = loadBundle(dir);
|
|
7544
|
+
return bundle.catalog.map(
|
|
7545
|
+
(entry) => entry.resource ?? resolveArticlePath(dir, entry.file)
|
|
7546
|
+
);
|
|
7547
|
+
}
|
|
7532
7548
|
function resolveArticlePath(dir, file) {
|
|
7533
7549
|
if (file.includes("/") || file.includes("\\") || file.includes("..")) {
|
|
7534
7550
|
throw new Error(`invalid article file name: ${file}`);
|
|
@@ -10725,7 +10741,7 @@ async function readWebLink(url) {
|
|
|
10725
10741
|
redirect: "manual",
|
|
10726
10742
|
signal: controller.signal,
|
|
10727
10743
|
headers: {
|
|
10728
|
-
"User-Agent": "ZAM-Content-Studio/0.
|
|
10744
|
+
"User-Agent": "ZAM-Content-Studio/0.15.0"
|
|
10729
10745
|
}
|
|
10730
10746
|
});
|
|
10731
10747
|
if (res.status >= 300 && res.status < 400) {
|
|
@@ -32381,7 +32397,12 @@ bridgeCommand.command("list-tokens").description(
|
|
|
32381
32397
|
).option("--domain <domain>", "Filter by exact domain").option(
|
|
32382
32398
|
"--domain-prefix <prefix>",
|
|
32383
32399
|
"Filter by domain prefix (e.g. company-team) \u2014 uses / separator for hierarchy"
|
|
32384
|
-
).option("--knowledge-context <context>", "Filter by knowledge context").
|
|
32400
|
+
).option("--knowledge-context <context>", "Filter by knowledge context").option(
|
|
32401
|
+
"--source-link-base <base>",
|
|
32402
|
+
"Filter by source-link base (exact or '<base>#<anchor>', as written by OKF imports); repeatable",
|
|
32403
|
+
(value, previous) => [...previous, value],
|
|
32404
|
+
[]
|
|
32405
|
+
).action(async (opts) => {
|
|
32385
32406
|
await withDb2(async (db) => {
|
|
32386
32407
|
const userId = opts.user ? await resolveUser(opts, db, { json: true }) : void 0;
|
|
32387
32408
|
const listOpts = {};
|
|
@@ -32389,6 +32410,8 @@ bridgeCommand.command("list-tokens").description(
|
|
|
32389
32410
|
if (opts.domainPrefix) listOpts.domainPrefix = opts.domainPrefix;
|
|
32390
32411
|
if (opts.knowledgeContext)
|
|
32391
32412
|
listOpts.knowledgeContext = opts.knowledgeContext;
|
|
32413
|
+
if (opts.sourceLinkBase.length)
|
|
32414
|
+
listOpts.sourceLinkBases = opts.sourceLinkBase;
|
|
32392
32415
|
const tokens = await listTokens(
|
|
32393
32416
|
db,
|
|
32394
32417
|
Object.keys(listOpts).length ? listOpts : void 0
|