kibi-plugin-builtin 0.4.0 → 0.4.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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# kibi-plugin-builtin
|
|
2
2
|
|
|
3
|
+
## 0.4.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2a2b2db: Every Kibi package page on npm now has a README that says what the package is for and how to install it, and links to the documentation site. Package metadata now points npm's "Homepage" link at the documentation site, its "Repository" link at the package's own folder on GitHub, and adds an "Issues" link.
|
|
8
|
+
|
|
9
|
+
Adds READMEs to `kibi-cli`, `kibi-mcp`, `kibi-core`, `kibi-runtime`, `kibi-agent-core`, `kibi-codex`, `kibi-plugin-builtin` and `kibi-plugin-sdk`. Sets `homepage` to https://looted.github.io/kibi/, adds `repository.directory` and `bugs` to every package, and refreshes the `kibi-plugin-treesitter` integrity manifest and source-analyzer approval for its changed `package.json`.
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [2a2b2db]
|
|
12
|
+
- kibi-plugin-sdk@0.4.1
|
|
13
|
+
|
|
14
|
+
## 0.4.1
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- d25a626: Kibi now answers questions on a CI checkout or any detached commit, compiles a cold knowledge base minutes faster, and can stop a runaway read before it blocks other agents. On a bare SHA, search, query, status, check, coverage and graph read a snapshot of that checkout and say so in every answer, while writes are refused with the command that fixes it. A cold `kibi sync` of the Kibi repository went from about 4 min 23 s to 19 s, and `--refresh-symbol-coordinates` from about 5 min 55 s to 26 s, with byte-identical results.
|
|
19
|
+
- Detached HEAD with zero or several local branches at HEAD: read-only operations (CLI routes, human commands, MCP tools) attach a read-only snapshot store (`kibi-internal/detached-head-snapshot`) compiled incrementally from the checkout's tracked sources, and add a `detached_head_read_only` warning diagnostic with the commit, branches at HEAD, store path and `writes: "refused"`. Write operations and `kibi sync` refuse with an actionable message (`git switch <branch>`, `git switch -c <branch>`, or `KIBI_BRANCH`). One branch at HEAD still attaches that branch exactly; no branch KB is ever guessed or written. `kibi engine stop/status` address the snapshot daemon, and `kibi gc` keeps the snapshot while it is in use.
|
|
20
|
+
- Sync: source-owned entity lookups before retracts run in batches of 200 instead of one engine round trip per path candidate; the Prolog client wakes on the answer frame instead of a 50 ms poll; TypeScript coordinate enrichment adds every source file before the first export check, so the type checker program is built once instead of once per file.
|
|
21
|
+
- Engine read limits: `KIBI_ENGINE_READ_TIME_LIMIT_MS` and `KIBI_ENGINE_READ_INFERENCE_LIMIT` (opt-in, unset by default) bound each read-only engine request with `call_with_time_limit/2` and `call_with_inference_limit/3`. A read that hits its limit fails with `QUERY_LIMIT_EXCEEDED` and `error.details.limitExceeded` (`kind`, `limit`) on the CLI and MCP envelopes, never with a partial answer; write requests, module loads and sync compilation are never bounded, while the read-only queries a write operation such as `kb_upsert` runs before writing count as reads and can stop it before anything is written.
|
|
22
|
+
- A CLI JSON route whose runtime cannot open (a detached HEAD refusing a write, no branch to attach) now prints an `OPERATION_FAILED` error envelope on stdout, not just a message on stderr.
|
|
23
|
+
|
|
3
24
|
## 0.4.0
|
|
4
25
|
|
|
5
26
|
### Minor Changes
|
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# kibi-plugin-builtin
|
|
2
|
+
|
|
3
|
+
The default capability plugin for [Kibi](https://looted.github.io/kibi/). It provides TypeScript and JavaScript symbol extraction (via ts-morph), the builtin ontology pack, the semantic classifier and vocabulary alignment.
|
|
4
|
+
|
|
5
|
+
It ships with the standard Kibi distribution and is always registered, so you never list it in `kibi.plugins` or install it by hand. To add languages beyond TypeScript and JavaScript, see the optional [`kibi-plugin-treesitter`](https://www.npmjs.com/package/kibi-plugin-treesitter); to write your own, see [capability plugins](https://looted.github.io/kibi/reference/plugins.html) and [`kibi-plugin-sdk`](https://www.npmjs.com/package/kibi-plugin-sdk).
|
|
6
|
+
|
|
7
|
+
## Links
|
|
8
|
+
|
|
9
|
+
- [Documentation](https://looted.github.io/kibi/)
|
|
10
|
+
- [Source](https://github.com/Looted/kibi)
|
|
11
|
+
- [Issues](https://github.com/Looted/kibi/issues)
|
|
12
|
+
|
|
13
|
+
## License
|
|
14
|
+
|
|
15
|
+
AGPL-3.0-or-later
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ts-morph-enrichment.d.ts","sourceRoot":"","sources":["../../src/symbols/ts-morph-enrichment.ts"],"names":[],"mappings":"AAmCA,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,sBAAsB,EAAE,MAAM,CAAC;CAChC;AAGD,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAKD,wBAAsB,kCAAkC,CACtD,OAAO,EAAE,mBAAmB,EAAE,EAC9B,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,mBAAmB,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"ts-morph-enrichment.d.ts","sourceRoot":"","sources":["../../src/symbols/ts-morph-enrichment.ts"],"names":[],"mappings":"AAmCA,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,sBAAsB,EAAE,MAAM,CAAC;CAChC;AAGD,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAKD,wBAAsB,kCAAkC,CACtD,OAAO,EAAE,mBAAmB,EAAE,EAC9B,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,mBAAmB,EAAE,CAAC,CA8FhC"}
|
|
@@ -25,10 +25,32 @@ export async function enrichSymbolCoordinatesWithTsMorph(entries, workspaceRoot)
|
|
|
25
25
|
skipAddingFilesFromTsConfig: true,
|
|
26
26
|
});
|
|
27
27
|
const sourceFileCache = new Map();
|
|
28
|
-
|
|
28
|
+
// Add every source file before the first declaration lookup. Export checks
|
|
29
|
+
// consult the type checker, and adding a file discards the program, so
|
|
30
|
+
// interleaving adds with lookups rebuilt the whole program (and its module
|
|
31
|
+
// resolution) once per newly seen file. A declaration's own symbol does
|
|
32
|
+
// not depend on which other root files are present, so the coordinates are
|
|
33
|
+
// unchanged; only the repeated program construction disappears.
|
|
34
|
+
const resolvedPaths = [];
|
|
29
35
|
for (const entry of entries) {
|
|
30
36
|
try {
|
|
31
37
|
const absolutePath = await resolveSourcePath(entry.sourceFile, workspaceRoot);
|
|
38
|
+
if (absolutePath) {
|
|
39
|
+
getOrAddSourceFile(project, sourceFileCache, absolutePath);
|
|
40
|
+
}
|
|
41
|
+
resolvedPaths.push({ ok: true, absolutePath });
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
resolvedPaths.push({ ok: false, error });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const enriched = [];
|
|
48
|
+
for (const [index, entry] of entries.entries()) {
|
|
49
|
+
try {
|
|
50
|
+
const resolved = resolvedPaths[index];
|
|
51
|
+
if (resolved !== undefined && !resolved.ok)
|
|
52
|
+
throw resolved.error;
|
|
53
|
+
const absolutePath = resolved?.absolutePath ?? null;
|
|
32
54
|
if (!absolutePath) {
|
|
33
55
|
enriched.push(entry);
|
|
34
56
|
continue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kibi-plugin-builtin",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Default Kibi capability plugins: TS symbol extraction, ontology pack, and semantic classifier",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -24,15 +24,20 @@
|
|
|
24
24
|
},
|
|
25
25
|
"license": "AGPL-3.0-or-later",
|
|
26
26
|
"author": "Piotr Franczyk",
|
|
27
|
+
"homepage": "https://looted.github.io/kibi/",
|
|
27
28
|
"repository": {
|
|
28
29
|
"type": "git",
|
|
29
|
-
"url": "https://github.com/Looted/kibi.git"
|
|
30
|
+
"url": "https://github.com/Looted/kibi.git",
|
|
31
|
+
"directory": "packages/plugin-builtin"
|
|
32
|
+
},
|
|
33
|
+
"bugs": {
|
|
34
|
+
"url": "https://github.com/Looted/kibi/issues"
|
|
30
35
|
},
|
|
31
36
|
"publishConfig": {
|
|
32
37
|
"access": "public"
|
|
33
38
|
},
|
|
34
39
|
"dependencies": {
|
|
35
|
-
"kibi-plugin-sdk": "^0.4.
|
|
40
|
+
"kibi-plugin-sdk": "^0.4.1",
|
|
36
41
|
"ts-morph": "^23.0.0"
|
|
37
42
|
},
|
|
38
43
|
"devDependencies": {
|