chapterhouse 0.9.0 → 0.9.2
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/agents/korg.agent.md +20 -0
- package/dist/api/korg.js +0 -17
- package/dist/api/route-coverage.test.js +1 -2
- package/dist/api/server.js +11 -13
- package/dist/copilot/tools.js +93 -38
- package/dist/copilot/tools.wiki.test.js +352 -3
- package/dist/memory/eot.js +113 -10
- package/dist/memory/eot.test.js +115 -0
- package/dist/shared/api-schemas.js +0 -3
- package/dist/store/db.js +1 -0
- package/dist/wiki/frontmatter.js +2 -1
- package/dist/wiki/frontmatter.test.js +2 -1
- package/dist/wiki/index-manager.js +1 -1
- package/dist/wiki/ingest.js +16 -0
- package/package.json +1 -1
- package/web/dist/assets/{index-tBfBbEk5.js → index-iQrv3lQN.js} +74 -76
- package/web/dist/assets/{index-tBfBbEk5.js.map → index-iQrv3lQN.js.map} +1 -1
- package/web/dist/index.html +1 -1
- package/dist/api/korg.test.js +0 -42
|
@@ -104,7 +104,8 @@ tags: [engineering, made-up-tag]
|
|
|
104
104
|
`, { allowedTags: ["engineering", "release"] });
|
|
105
105
|
assert.equal(result.valid, false);
|
|
106
106
|
assert.deepEqual(result.errors.map((error) => error.rule), ["unknown-tag"]);
|
|
107
|
-
assert.match(result.errors[0]?.message ?? "", /
|
|
107
|
+
assert.match(result.errors[0]?.message ?? "", /made-up-tag/);
|
|
108
|
+
assert.match(result.errors[0]?.message ?? "", /Valid tags: engineering, release/);
|
|
108
109
|
});
|
|
109
110
|
test("parseProjectRulesFrontmatter parses typed hard-rule fields and flags unknown keys", async () => {
|
|
110
111
|
const { parseProjectRulesFrontmatter } = await loadFrontmatterModule();
|
|
@@ -77,7 +77,7 @@ export function upsertWikiPage(path, frontmatter, summary) {
|
|
|
77
77
|
const db = getDb();
|
|
78
78
|
const normalizedPath = normalizeWikiPath(path);
|
|
79
79
|
const title = frontmatter.title ?? basenameTitle(normalizedPath);
|
|
80
|
-
const entityType = frontmatter.metadata?.["entity_type"] ??
|
|
80
|
+
const entityType = frontmatter.metadata?.["entity_type"] ?? categoryOfPath(normalizedPath);
|
|
81
81
|
const tags = JSON.stringify(frontmatter.tags ?? []);
|
|
82
82
|
const lastUpdated = frontmatter.updated ?? new Date().toISOString();
|
|
83
83
|
db.prepare(`
|
package/dist/wiki/ingest.js
CHANGED
|
@@ -331,6 +331,22 @@ export async function ingestSource(source, type, topic, session) {
|
|
|
331
331
|
// ---------------------------------------------------------------------------
|
|
332
332
|
// Type auto-detection
|
|
333
333
|
// ---------------------------------------------------------------------------
|
|
334
|
+
const URL_SCHEME_RE = /^[a-z][a-z0-9+.-]*:/i;
|
|
335
|
+
export function looksLikeLocalFilePath(source) {
|
|
336
|
+
const trimmed = source.trim();
|
|
337
|
+
if (!trimmed)
|
|
338
|
+
return false;
|
|
339
|
+
if (/^[a-z]:[\\/]/i.test(trimmed))
|
|
340
|
+
return true;
|
|
341
|
+
if (trimmed.startsWith("file://") || trimmed.startsWith("./") || trimmed.startsWith("../") || trimmed.startsWith("/") || trimmed.startsWith("~/")) {
|
|
342
|
+
return true;
|
|
343
|
+
}
|
|
344
|
+
if (URL_SCHEME_RE.test(trimmed))
|
|
345
|
+
return false;
|
|
346
|
+
if (/\s/.test(trimmed))
|
|
347
|
+
return false;
|
|
348
|
+
return trimmed.includes("/") || trimmed.includes("\\") || /\.[a-z0-9]+$/i.test(trimmed);
|
|
349
|
+
}
|
|
334
350
|
export function detectSourceType(source) {
|
|
335
351
|
const trimmed = source.trim();
|
|
336
352
|
if (trimmed.startsWith("http://") || trimmed.startsWith("https://")) {
|
package/package.json
CHANGED