@saasontools/strauss-kb 0.1.11 → 0.1.12
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 +8 -0
- package/dist/{chunk-OVRQCQ6P.js → chunk-33ZCBEUV.js} +25 -6
- package/dist/{chunk-OVRQCQ6P.js.map → chunk-33ZCBEUV.js.map} +1 -1
- package/dist/{chunk-CWWXMD35.js → chunk-EXKK2KUN.js} +2 -2
- package/dist/{chunk-I3WW4F6X.js → chunk-F2U2YLWV.js} +2 -2
- package/dist/cli-main.cjs +24 -5
- package/dist/cli-main.cjs.map +1 -1
- package/dist/cli-main.js +2 -2
- package/dist/index.cjs +24 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +3 -3
- package/dist/mcp-main.cjs +24 -5
- package/dist/mcp-main.cjs.map +1 -1
- package/dist/mcp-main.js +2 -2
- package/package.json +1 -1
- /package/dist/{chunk-CWWXMD35.js.map → chunk-EXKK2KUN.js.map} +0 -0
- /package/dist/{chunk-I3WW4F6X.js.map → chunk-F2U2YLWV.js.map} +0 -0
package/dist/cli-main.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1760,6 +1760,7 @@ ${answer}
|
|
|
1760
1760
|
const records = adjudicated.filter((hit) => hit.standing !== "superseded");
|
|
1761
1761
|
const superseded = adjudicated.filter((hit) => hit.standing === "superseded").map(stub);
|
|
1762
1762
|
const approxTokens2 = records.reduce((total, hit) => total + estimateTokens(hit.record), 0) + superseded.reduce((total, entry) => total + estimateStubTokens(entry), 0);
|
|
1763
|
+
const bundleDigestValue = bundleDigest(records, superseded);
|
|
1763
1764
|
if (!options.all && approxTokens2 > budgetTokens) {
|
|
1764
1765
|
return {
|
|
1765
1766
|
loaded: false,
|
|
@@ -1770,7 +1771,8 @@ ${answer}
|
|
|
1770
1771
|
approxTokens: approxTokens2,
|
|
1771
1772
|
budgetTokens,
|
|
1772
1773
|
type: options.type
|
|
1773
|
-
})
|
|
1774
|
+
}),
|
|
1775
|
+
digest: bundleDigestValue
|
|
1774
1776
|
};
|
|
1775
1777
|
}
|
|
1776
1778
|
return {
|
|
@@ -1779,7 +1781,8 @@ ${answer}
|
|
|
1779
1781
|
tokensLoaded: approxTokens2,
|
|
1780
1782
|
budgetTokens: options.all ? null : budgetTokens,
|
|
1781
1783
|
records,
|
|
1782
|
-
superseded
|
|
1784
|
+
superseded,
|
|
1785
|
+
digest: bundleDigestValue
|
|
1783
1786
|
};
|
|
1784
1787
|
}
|
|
1785
1788
|
/** How a position was arrived at, as a timeline. See `trace.ts`. */
|
|
@@ -2096,6 +2099,22 @@ function normalizeActor(id) {
|
|
|
2096
2099
|
function digest(contents) {
|
|
2097
2100
|
return (0, import_node_crypto2.createHash)("sha256").update(contents).digest("hex");
|
|
2098
2101
|
}
|
|
2102
|
+
function bundleDigest(records, superseded) {
|
|
2103
|
+
const entries = [
|
|
2104
|
+
...records.map(
|
|
2105
|
+
(hit) => `${hit.record.conceptId}:current:${digest(
|
|
2106
|
+
stringifyMarkdownWithFrontmatter(
|
|
2107
|
+
hit.record.body,
|
|
2108
|
+
hit.record.frontmatter
|
|
2109
|
+
)
|
|
2110
|
+
)}`
|
|
2111
|
+
),
|
|
2112
|
+
...superseded.map(
|
|
2113
|
+
(entry) => `${entry.conceptId}:superseded:${digest(JSON.stringify(entry))}`
|
|
2114
|
+
)
|
|
2115
|
+
].sort();
|
|
2116
|
+
return digest(entries.join("\n"));
|
|
2117
|
+
}
|
|
2099
2118
|
|
|
2100
2119
|
// src/record-types.ts
|
|
2101
2120
|
var RECORD_TYPES = {
|
|
@@ -3688,7 +3707,7 @@ var loadCommand = define({
|
|
|
3688
3707
|
name: "load",
|
|
3689
3708
|
tool: "kb_load",
|
|
3690
3709
|
usage: "load [type] [--budget N | --all] [--repo-root PATH]",
|
|
3691
|
-
description: "Loads the whole knowledge base at once, each record with its standing. Superseded records arrive as stubs
|
|
3710
|
+
description: "Loads the whole knowledge base at once, each record with its standing. Superseded records arrive as stubs; rejected and open records arrive whole. Refuses past the token budget \u2014 call kb_catalog, kb_pack on it; `all` bypasses the budget. Never read record files directly. Cache-stable; `digest` is the base's content stamp \u2014 hooks use it to tell you when to reload.",
|
|
3692
3711
|
input: import_zod14.z.object({
|
|
3693
3712
|
bundlePath,
|
|
3694
3713
|
type: import_zod14.z.enum(KB_RECORD_TYPES).optional(),
|
|
@@ -3931,7 +3950,7 @@ var queryCommand = define({
|
|
|
3931
3950
|
name: "query",
|
|
3932
3951
|
tool: "kb_query",
|
|
3933
3952
|
usage: "query <text...> [--repo-root PATH]",
|
|
3934
|
-
description: "Search
|
|
3953
|
+
description: "Search; every hit carries its standing. Flagged, never filtered: a superseded hit returns with its replacement, a rejected one is marked. Prefer kb_load when the base fits its budget \u2014 a full read beats search. Results are volatile: place them at the tail, not the cached prefix. Never read record files directly.",
|
|
3935
3954
|
input: import_zod20.z.object({
|
|
3936
3955
|
bundlePath,
|
|
3937
3956
|
text: import_zod20.z.string().optional(),
|
|
@@ -4279,7 +4298,7 @@ var import_mcp = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
|
4279
4298
|
var import_stdio = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
4280
4299
|
|
|
4281
4300
|
// src/version.ts
|
|
4282
|
-
var VERSION = true ? "0.1.
|
|
4301
|
+
var VERSION = true ? "0.1.12" : "0.0.0-dev";
|
|
4283
4302
|
|
|
4284
4303
|
// src/mcp.ts
|
|
4285
4304
|
function createKbMcpServer() {
|