@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
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
KB_COMMANDS,
|
|
3
3
|
KbStore,
|
|
4
4
|
VERSION
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-33ZCBEUV.js";
|
|
6
6
|
|
|
7
7
|
// src/mcp.ts
|
|
8
8
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
@@ -46,4 +46,4 @@ export {
|
|
|
46
46
|
createKbMcpServer,
|
|
47
47
|
runKbMcpServer
|
|
48
48
|
};
|
|
49
|
-
//# sourceMappingURL=chunk-
|
|
49
|
+
//# sourceMappingURL=chunk-EXKK2KUN.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
KB_DIR,
|
|
5
5
|
KbStore,
|
|
6
6
|
VERSION
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-33ZCBEUV.js";
|
|
8
8
|
|
|
9
9
|
// src/cli.ts
|
|
10
10
|
import { join } from "path";
|
|
@@ -112,4 +112,4 @@ function usage() {
|
|
|
112
112
|
export {
|
|
113
113
|
runKbCli
|
|
114
114
|
};
|
|
115
|
-
//# sourceMappingURL=chunk-
|
|
115
|
+
//# sourceMappingURL=chunk-F2U2YLWV.js.map
|
package/dist/cli-main.cjs
CHANGED
|
@@ -2470,7 +2470,7 @@ var loadCommand = define({
|
|
|
2470
2470
|
name: "load",
|
|
2471
2471
|
tool: "kb_load",
|
|
2472
2472
|
usage: "load [type] [--budget N | --all] [--repo-root PATH]",
|
|
2473
|
-
description: "Loads the whole knowledge base at once, each record with its standing. Superseded records arrive as stubs
|
|
2473
|
+
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.",
|
|
2474
2474
|
input: import_zod12.z.object({
|
|
2475
2475
|
bundlePath,
|
|
2476
2476
|
type: import_zod12.z.enum(KB_RECORD_TYPES).optional(),
|
|
@@ -2713,7 +2713,7 @@ var queryCommand = define({
|
|
|
2713
2713
|
name: "query",
|
|
2714
2714
|
tool: "kb_query",
|
|
2715
2715
|
usage: "query <text...> [--repo-root PATH]",
|
|
2716
|
-
description: "Search
|
|
2716
|
+
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.",
|
|
2717
2717
|
input: import_zod18.z.object({
|
|
2718
2718
|
bundlePath,
|
|
2719
2719
|
text: import_zod18.z.string().optional(),
|
|
@@ -3733,6 +3733,7 @@ ${answer}
|
|
|
3733
3733
|
const records = adjudicated.filter((hit) => hit.standing !== "superseded");
|
|
3734
3734
|
const superseded = adjudicated.filter((hit) => hit.standing === "superseded").map(stub);
|
|
3735
3735
|
const approxTokens2 = records.reduce((total, hit) => total + estimateTokens(hit.record), 0) + superseded.reduce((total, entry) => total + estimateStubTokens(entry), 0);
|
|
3736
|
+
const bundleDigestValue = bundleDigest(records, superseded);
|
|
3736
3737
|
if (!options.all && approxTokens2 > budgetTokens) {
|
|
3737
3738
|
return {
|
|
3738
3739
|
loaded: false,
|
|
@@ -3743,7 +3744,8 @@ ${answer}
|
|
|
3743
3744
|
approxTokens: approxTokens2,
|
|
3744
3745
|
budgetTokens,
|
|
3745
3746
|
type: options.type
|
|
3746
|
-
})
|
|
3747
|
+
}),
|
|
3748
|
+
digest: bundleDigestValue
|
|
3747
3749
|
};
|
|
3748
3750
|
}
|
|
3749
3751
|
return {
|
|
@@ -3752,7 +3754,8 @@ ${answer}
|
|
|
3752
3754
|
tokensLoaded: approxTokens2,
|
|
3753
3755
|
budgetTokens: options.all ? null : budgetTokens,
|
|
3754
3756
|
records,
|
|
3755
|
-
superseded
|
|
3757
|
+
superseded,
|
|
3758
|
+
digest: bundleDigestValue
|
|
3756
3759
|
};
|
|
3757
3760
|
}
|
|
3758
3761
|
/** How a position was arrived at, as a timeline. See `trace.ts`. */
|
|
@@ -4069,9 +4072,25 @@ function normalizeActor(id) {
|
|
|
4069
4072
|
function digest(contents) {
|
|
4070
4073
|
return (0, import_node_crypto2.createHash)("sha256").update(contents).digest("hex");
|
|
4071
4074
|
}
|
|
4075
|
+
function bundleDigest(records, superseded) {
|
|
4076
|
+
const entries = [
|
|
4077
|
+
...records.map(
|
|
4078
|
+
(hit) => `${hit.record.conceptId}:current:${digest(
|
|
4079
|
+
stringifyMarkdownWithFrontmatter(
|
|
4080
|
+
hit.record.body,
|
|
4081
|
+
hit.record.frontmatter
|
|
4082
|
+
)
|
|
4083
|
+
)}`
|
|
4084
|
+
),
|
|
4085
|
+
...superseded.map(
|
|
4086
|
+
(entry) => `${entry.conceptId}:superseded:${digest(JSON.stringify(entry))}`
|
|
4087
|
+
)
|
|
4088
|
+
].sort();
|
|
4089
|
+
return digest(entries.join("\n"));
|
|
4090
|
+
}
|
|
4072
4091
|
|
|
4073
4092
|
// src/version.ts
|
|
4074
|
-
var VERSION = true ? "0.1.
|
|
4093
|
+
var VERSION = true ? "0.1.12" : "0.0.0-dev";
|
|
4075
4094
|
|
|
4076
4095
|
// src/cli.ts
|
|
4077
4096
|
async function runKbCli(argv) {
|