@jini-ai/registry 0.5.1 → 0.5.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 +4 -0
- package/dist/index.d.ts +11 -62
- package/dist/tool-catalog-builder/ports.d.ts +3 -0
- package/dist/tool-catalog-builder/query.js +3 -1
- package/dist/tool-catalog-builder/search-enricher.d.ts +4 -2
- package/dist/tool-catalog-builder/search-enricher.js +8 -4
- package/package.json +18 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## 0.5.2 — 2026-10-08
|
|
2
|
+
|
|
3
|
+
- Tovu clean-up release: code Tovu moved into Jini, plus the Jini clean-up (see the commit log).
|
|
4
|
+
|
|
1
5
|
## 0.5.1 — 2026-10-05
|
|
2
6
|
|
|
3
7
|
- The `@jini-ai/db` peer range is `^0.2.0 || ^0.3.0` (registry uses only db's SQLite entry, which 0.3.0 leaves unchanged), so a host on db 0.3.0 installs without a peer conflict.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,67 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module @jini-ai/registry
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* The task brief suggested `@jini/core` as a likely home. Read `@jini/core`'s
|
|
15
|
-
* own `archived provenance ledger` first: its charter is explicitly composition-only — "a
|
|
16
|
-
* from-scratch implementation of the typed composition contract... there is
|
|
17
|
-
* nothing to port" — it holds zero concrete port/adapter implementations
|
|
18
|
-
* today (`token.ts`/`pack.ts`/`bindings.ts`/`daemon.ts` are all pure DI
|
|
19
|
-
* machinery). Adding stateful backend classes (in-memory, GitHub-PR-mutating,
|
|
20
|
-
* sqlite-backed) would be a first-of-its-kind widening of that charter, which
|
|
21
|
-
* reads as exactly the kind of ad-hoc scope creep extraction-plan.md §9 warns
|
|
22
|
-
* against ("a new kernel token requires a kernel invariant, not merely a need
|
|
23
|
-
* discovered by the first consumer").
|
|
24
|
-
*
|
|
25
|
-
* `@jini/sqlite` was the other candidate (it already holds one concrete
|
|
26
|
-
* `better-sqlite3`-backed adapter, `event-log.ts`, implementing `@jini/daemon`'s
|
|
27
|
-
* `EventLog` port). But `@jini/sqlite`'s own archived provenance ledger scopes it
|
|
28
|
-
* specifically to durable adapters for daemon/core kernel ports; a registry
|
|
29
|
-
* backend is not a kernel port and two of the three backends here
|
|
30
|
-
* (`static`/`github`) have no sqlite dependency at all.
|
|
31
|
-
*
|
|
32
|
-
* Instead this follows the same shape as `@jini/sqlite` itself: `@jini/protocol`
|
|
33
|
-
* defines the pure wire types and the `RegistryBackend` port (already true
|
|
34
|
-
* before this change — see "What already existed" below); this new leaf
|
|
35
|
-
* package holds concrete backend implementations against that port, exactly
|
|
36
|
-
* as `@jini/sqlite` holds concrete `EventLog` implementations against
|
|
37
|
-
* `@jini/daemon`'s port.
|
|
38
|
-
*
|
|
39
|
-
* ## 2026-10-02 registry merge and object arguments (dbpkg-registry)
|
|
40
|
-
*
|
|
41
|
-
* The catalog-builder subpath keeps descriptor enumeration, source classification,
|
|
42
|
-
* search vocabulary and clock policy behind host ports. Its SQLite bridge lives in
|
|
43
|
-
* `src/tool-catalog-builder/sqlite.ts`, separately from the provider-free barrel,
|
|
44
|
-
* so a browser or alternate search backend never acquires a storage dependency.
|
|
45
|
-
* The bridge borrows its connection; the caller allocates one database per independent
|
|
46
|
-
* snapshot and owns retirement. Reusing the same database intentionally reseeds that
|
|
47
|
-
* shared snapshot rather than allocating or closing an implicit default database.
|
|
48
|
-
*
|
|
49
|
-
* All existing public export names are retained. Functions and constructors now take
|
|
50
|
-
* required argument objects followed by optional argument objects; no old-shape
|
|
51
|
-
* wrappers or aliases were added. Backend methods match the current protocol port.
|
|
52
|
-
* `src/ports.ts` defines database, HTTP and clock seams. The GitHub client passes the
|
|
53
|
-
* existing QUICK timeout to its required transport port, which owns timeout error
|
|
54
|
-
* and cancellation behavior. Default timestamps still use the system clock. SQL,
|
|
55
|
-
* transaction boundaries, canonical signing bytes, BM25 weights and error messages
|
|
56
|
-
* for valid argument shapes remain unchanged. Unknown trust/backend modes now fail
|
|
57
|
-
* closed through the existing protocol schemas.
|
|
58
|
-
*
|
|
59
|
-
* No rationale comment was removed by this job. Manifest/barrel/changelog merge
|
|
60
|
-
* proposals and cross-package caller needs are recorded in
|
|
61
|
-
* `dbpkg-registry-merge-needs.json` and `dbpkg-registry-handoff.md`. The existing dirty
|
|
62
|
-
* manifest, root barrel and changelog remain owned by their previous writers.
|
|
63
|
-
* Tests are written; execution, typecheck, build and packaging are UNPROVEN because
|
|
64
|
-
* the owner explicitly deferred verification. No version change or lockfile edit.
|
|
3
|
+
* Concrete static/GitHub/database backends implement the protocol-owned RegistryBackend port.
|
|
4
|
+
* Keep them outside composition-only core and kernel-store adapters: registry storage is a
|
|
5
|
+
* feature concern, and static/GitHub backends need no SQLite dependency.
|
|
6
|
+
* Catalog-building enumeration, classification, search vocabulary and clock policy are host ports.
|
|
7
|
+
* Its SQLite bridge is a separate entry so browser/alternate-search consumers remain storage-free.
|
|
8
|
+
* The bridge borrows its connection; hosts own snapshot allocation and retirement. Reusing one
|
|
9
|
+
* database deliberately reseeds that snapshot, never allocates/closes an implicit default.
|
|
10
|
+
* Public functions/constructors take required and optional argument objects; backend methods follow
|
|
11
|
+
* the protocol port. The required GitHub transport owns QUICK timeout/cancellation behavior.
|
|
12
|
+
* Signing bytes, transaction boundaries and BM25 policy stay at their owning implementations;
|
|
13
|
+
* protocol schemas reject unknown trust/backend modes rather than guessing.
|
|
65
14
|
*/
|
|
66
15
|
export type { ParsedRegistrySpecifier, ResolvedRegistryEntryVersion } from './versioning.js';
|
|
67
16
|
export { parseRegistrySpecifier, resolveRegistryEntryVersion } from './versioning.js';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Clock } from '@jini-ai/core/primitives';
|
|
2
|
+
import type { ToolMetadata } from '@jini-ai/core';
|
|
2
3
|
/** Structural contracts only: callers choose their registry and search backend. */
|
|
3
4
|
export interface ToolDescriptor {
|
|
5
|
+
readonly metadata?: ToolMetadata;
|
|
4
6
|
readonly id: string;
|
|
5
7
|
readonly description?: string | undefined;
|
|
6
8
|
readonly inputSchema?: unknown;
|
|
@@ -38,6 +40,7 @@ export interface SearchEnricher {
|
|
|
38
40
|
indexedDescription(required: {
|
|
39
41
|
id: string;
|
|
40
42
|
description: string;
|
|
43
|
+
metadata?: ToolMetadata;
|
|
41
44
|
}, optional: {
|
|
42
45
|
includeDoc2query: boolean;
|
|
43
46
|
}): string;
|
|
@@ -30,7 +30,9 @@ export function buildToolCatalogQuery(required, optional = {}) {
|
|
|
30
30
|
id: descriptor.id,
|
|
31
31
|
source: required.classifier.classify({ id: descriptor.id }),
|
|
32
32
|
description: (optional.includeSearchKeywords ?? true)
|
|
33
|
-
? required.enricher.indexedDescription({ id: descriptor.id, description
|
|
33
|
+
? required.enricher.indexedDescription({ id: descriptor.id, description,
|
|
34
|
+
...(descriptor.metadata ? { metadata: descriptor.metadata } : {}),
|
|
35
|
+
}, {
|
|
34
36
|
includeDoc2query: optional.includeDoc2query ?? true,
|
|
35
37
|
}) : description,
|
|
36
38
|
...(descriptor.inputSchema === undefined ? {} : { inputSchema: descriptor.inputSchema }),
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { SearchEnricher, SourceClassifier } from './ports.js';
|
|
2
|
-
/** Host vocabulary and boundary marker are required; no product dictionary ships here.
|
|
2
|
+
/** Host vocabulary and boundary marker are required; no product dictionary ships here.
|
|
3
|
+
* Registered search metadata takes precedence over legacy dictionaries. The marker and question
|
|
4
|
+
* switch remain host-controlled so an index migration cannot silently change authored copy. */
|
|
3
5
|
export declare function createSearchEnricher(required: {
|
|
4
6
|
marker: string;
|
|
5
7
|
keywords: Readonly<Record<string, string>>;
|
|
6
8
|
questions: Readonly<Record<string, readonly string[]>>;
|
|
7
|
-
}): SearchEnricher;
|
|
9
|
+
}, _optional?: Record<string, never>): SearchEnricher;
|
|
8
10
|
/** Source naming conventions are supplied by the host, including the orphan-ID fallback. */
|
|
9
11
|
export declare function createPrefixSourceClassifier(required: {
|
|
10
12
|
separator: string;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
/** Host vocabulary and boundary marker are required; no product dictionary ships here.
|
|
2
|
-
|
|
1
|
+
/** Host vocabulary and boundary marker are required; no product dictionary ships here.
|
|
2
|
+
* Registered search metadata takes precedence over legacy dictionaries. The marker and question
|
|
3
|
+
* switch remain host-controlled so an index migration cannot silently change authored copy. */
|
|
4
|
+
export function createSearchEnricher(required, _optional = {}) {
|
|
3
5
|
const { marker, keywords, questions } = required;
|
|
4
6
|
if (!marker)
|
|
5
7
|
throw new Error('search vocabulary marker must not be empty');
|
|
6
8
|
return {
|
|
7
|
-
indexedDescription({ id, description }, { includeDoc2query }) {
|
|
8
|
-
const
|
|
9
|
+
indexedDescription({ id, description, metadata }, { includeDoc2query }) {
|
|
10
|
+
const vocabulary = metadata?.search?.keywords ?? (Object.hasOwn(keywords, id) ? keywords[id] : undefined);
|
|
11
|
+
const queries = metadata?.search?.queries ?? (Object.hasOwn(questions, id) ? questions[id] : undefined);
|
|
12
|
+
const tail = [vocabulary, includeDoc2query ? queries?.join(' ') : undefined]
|
|
9
13
|
.filter(part => Boolean(part?.length)).join(' ');
|
|
10
14
|
if (!tail)
|
|
11
15
|
return description;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jini-ai/registry",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Pluggable content-registry backends (static, GitHub, database) and semver specifier resolution over @jini-ai/protocol’s registry wire types.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -18,6 +18,12 @@
|
|
|
18
18
|
"./tool-catalog/sqlite": "node",
|
|
19
19
|
"./tool-catalog-builder": "universal",
|
|
20
20
|
"./tool-catalog-builder/sqlite": "node"
|
|
21
|
+
},
|
|
22
|
+
"isolation": {
|
|
23
|
+
"entries": {
|
|
24
|
+
"./tool-catalog-builder": "tool-catalog",
|
|
25
|
+
"./tool-catalog-builder/sqlite": "tool-catalog"
|
|
26
|
+
}
|
|
21
27
|
}
|
|
22
28
|
},
|
|
23
29
|
"type": "module",
|
|
@@ -68,13 +74,13 @@
|
|
|
68
74
|
"registry": "https://registry.npmjs.org"
|
|
69
75
|
},
|
|
70
76
|
"dependencies": {
|
|
71
|
-
"@jini-ai/
|
|
72
|
-
"@jini-ai/
|
|
73
|
-
"@jini-ai/core": "^0.4.1"
|
|
77
|
+
"@jini-ai/protocol": "^0.4.2",
|
|
78
|
+
"@jini-ai/core": "^0.4.2"
|
|
74
79
|
},
|
|
75
80
|
"peerDependencies": {
|
|
76
81
|
"better-sqlite3": "^13.0.0",
|
|
77
|
-
"@jini-ai/db": "^0.2.0 || ^0.3.0"
|
|
82
|
+
"@jini-ai/db": "^0.2.0 || ^0.3.0",
|
|
83
|
+
"@jini-ai/platform": "^0.5.1"
|
|
78
84
|
},
|
|
79
85
|
"peerDependenciesMeta": {
|
|
80
86
|
"better-sqlite3": {
|
|
@@ -82,12 +88,18 @@
|
|
|
82
88
|
},
|
|
83
89
|
"@jini-ai/db": {
|
|
84
90
|
"optional": true
|
|
91
|
+
},
|
|
92
|
+
"@jini-ai/platform": {
|
|
93
|
+
"optional": true
|
|
85
94
|
}
|
|
86
95
|
},
|
|
87
96
|
"devDependencies": {
|
|
88
97
|
"@types/better-sqlite3": "^7.6.11",
|
|
89
98
|
"better-sqlite3": "^13.0.0",
|
|
90
|
-
"@jini-ai/db": "0.3.
|
|
99
|
+
"@jini-ai/db": "0.3.1",
|
|
100
|
+
"@jini-ai/protocol": "^0.4.2",
|
|
101
|
+
"@jini-ai/core": "^0.4.2",
|
|
102
|
+
"@jini-ai/platform": "^0.5.2"
|
|
91
103
|
},
|
|
92
104
|
"scripts": {
|
|
93
105
|
"build": "tsc -p tsconfig.json",
|