kibi-core 0.15.0 → 0.15.1

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.
Files changed (3) hide show
  1. package/README.md +21 -0
  2. package/package.json +8 -6
  3. package/src/kb.pl +11 -2
package/README.md ADDED
@@ -0,0 +1,21 @@
1
+ # kibi-core
2
+
3
+ The Prolog knowledge-base core of [Kibi](https://looted.github.io/kibi/): the entity and relationship schema, validation rules, inference, contradiction and proof checks that `kibi-cli` and `kibi-mcp` run against a repository's `.kb/` directory.
4
+
5
+ This package ships Prolog sources only (`src/kb.pl` is the entry module). You do not call it directly; install it with the CLI and MCP server:
6
+
7
+ ```bash
8
+ npm install --save-dev kibi-core kibi-cli kibi-mcp
9
+ ```
10
+
11
+ The [entity schema](https://looted.github.io/kibi/reference/entity-schema.html) and [inference rules](https://looted.github.io/kibi/reference/inference-rules.html) references describe what it encodes.
12
+
13
+ ## Links
14
+
15
+ - [Documentation](https://looted.github.io/kibi/)
16
+ - [Source](https://github.com/Looted/kibi)
17
+ - [Issues](https://github.com/Looted/kibi/issues)
18
+
19
+ ## License
20
+
21
+ AGPL-3.0-or-later
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kibi-core",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "private": false,
5
5
  "description": "Core Prolog modules and RDF graph logic for Kibi",
6
6
  "type": "module",
@@ -8,14 +8,16 @@
8
8
  "node": ">=18"
9
9
  },
10
10
  "main": "./src/kb.pl",
11
- "files": [
12
- "src/**/*.pl",
13
- "schema/**/*.pl"
14
- ],
11
+ "files": ["src/**/*.pl", "schema/**/*.pl"],
15
12
  "license": "AGPL-3.0-or-later",
16
13
  "author": "Piotr Franczyk",
14
+ "homepage": "https://looted.github.io/kibi/",
17
15
  "repository": {
18
16
  "type": "git",
19
- "url": "https://github.com/Looted/kibi.git"
17
+ "url": "https://github.com/Looted/kibi.git",
18
+ "directory": "packages/core"
19
+ },
20
+ "bugs": {
21
+ "url": "https://github.com/Looted/kibi/issues"
20
22
  }
21
23
  }
package/src/kb.pl CHANGED
@@ -26,6 +26,7 @@
26
26
  kb_query_entities/8,
27
27
  kb_search_entities/6,
28
28
  kb_list_search_candidates/5,
29
+ kb_list_search_candidates/6,
29
30
  kb_entity_ids/1,
30
31
  kb_rebuild_indexes/0,
31
32
  kb_entity/3,
@@ -1816,14 +1817,22 @@ kb_search_entities(TypeFilter, Query, Limit, Offset, Rows, Count) :-
1816
1817
  % candidate rows, ordered by id. Semantic discovery uses it when no lexical
1817
1818
  % token can pre-filter the candidate set.
1818
1819
  kb_list_search_candidates(TypeFilter, Limit, Offset, Rows, Count) :-
1820
+ kb_list_search_candidates(TypeFilter, none, Limit, Offset, Rows, Count).
1821
+
1822
+ %% kb_list_search_candidates(+Type, +Source, +Limit, +Offset, -Rows, -Count)
1823
+ % As kb_list_search_candidates/5, optionally restricted to entities whose
1824
+ % indexed source contains Source (the kb_query_entities/8 source filter).
1825
+ % Source-located search uses it so candidates stay projected rows instead of
1826
+ % complete entities.
1827
+ % implements REQ-mcp-search-discovery, REQ-kibi-intent-aware-source-discovery
1828
+ kb_list_search_candidates(TypeFilter, SourceFilter, Limit, Offset, Rows, Count) :-
1819
1829
  integer(Limit),
1820
1830
  integer(Offset),
1821
1831
  Limit >= 0,
1822
1832
  Offset >= 0,
1823
1833
  kb_ensure_indexes,
1824
1834
  findall(Id,
1825
- ( kb_index_entity(Id, _),
1826
- (TypeFilter == none -> true ; kb_index_type(TypeFilter, Id)) ),
1835
+ indexed_entity_match(TypeFilter, none, [], SourceFilter, Id),
1827
1836
  RawIds),
1828
1837
  sort(RawIds, Ids),
1829
1838
  length(Ids, Count),