kibi-cli 2.35.1 → 2.38.0
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/dist/cli-operation-metadata.d.ts +1 -1
- package/dist/cli-operation-metadata.js +1 -1
- package/dist/cli-register-foundation.d.ts.map +1 -1
- package/dist/cli-register-foundation.js +2 -1
- package/dist/cli-register-maintenance.d.ts.map +1 -1
- package/dist/cli-register-maintenance.js +5 -0
- package/dist/cli-validate.d.ts.map +1 -1
- package/dist/cli-validate.js +21 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +16 -1
- package/dist/commands/aggregated-checks.d.ts.map +1 -1
- package/dist/commands/aggregated-checks.js +89 -16
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +56 -35
- package/dist/commands/github-init.d.ts.map +1 -1
- package/dist/commands/github-init.js +4 -2
- package/dist/commands/hook-managers.d.ts +43 -0
- package/dist/commands/hook-managers.d.ts.map +1 -0
- package/dist/commands/hook-managers.js +426 -0
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +40 -5
- package/dist/commands/sync/persistence.d.ts.map +1 -1
- package/dist/commands/sync/persistence.js +43 -1
- package/dist/commands/telemetry.d.ts +7 -0
- package/dist/commands/telemetry.d.ts.map +1 -0
- package/dist/commands/telemetry.js +23 -0
- package/dist/decision-firmness.d.ts.map +1 -1
- package/dist/decision-firmness.js +11 -14
- package/dist/engine-limits.d.ts.map +1 -1
- package/dist/engine-limits.js +8 -10
- package/dist/entity-body-context.d.ts.map +1 -1
- package/dist/entity-body-context.js +39 -36
- package/dist/extractors/symbol-coordinates.d.ts.map +1 -1
- package/dist/extractors/symbol-coordinates.js +23 -4
- package/dist/firm-decision-edit.d.ts.map +1 -1
- package/dist/firm-decision-edit.js +1 -3
- package/dist/intent-search.d.ts +5 -1
- package/dist/intent-search.d.ts.map +1 -1
- package/dist/intent-search.js +118 -33
- package/dist/logic/ir.d.ts.map +1 -1
- package/dist/logic/ir.js +82 -108
- package/dist/operations/bootstrap/guidance-actions.d.ts.map +1 -1
- package/dist/operations/bootstrap/guidance-actions.js +2 -1
- package/dist/operations/bootstrap/plugin-offers.d.ts +11 -2
- package/dist/operations/bootstrap/plugin-offers.d.ts.map +1 -1
- package/dist/operations/bootstrap/plugin-offers.js +48 -9
- package/dist/operations/proof/claim-bindings.d.ts.map +1 -1
- package/dist/operations/proof/claim-bindings.js +1 -0
- package/dist/operations/proof/code-certificates.d.ts +2 -0
- package/dist/operations/proof/code-certificates.d.ts.map +1 -1
- package/dist/operations/proof/code-certificates.js +34 -14
- package/dist/operations/proof/code-models.d.ts.map +1 -1
- package/dist/operations/proof/code-models.js +19 -5
- package/dist/operations/proof/code-runner.d.ts +16 -0
- package/dist/operations/proof/code-runner.d.ts.map +1 -1
- package/dist/operations/proof/code-runner.js +42 -6
- package/dist/plugins/compose-search-hints.d.ts +29 -0
- package/dist/plugins/compose-search-hints.d.ts.map +1 -0
- package/dist/plugins/compose-search-hints.js +94 -0
- package/dist/plugins/external-allowlist.d.ts +7 -0
- package/dist/plugins/external-allowlist.d.ts.map +1 -1
- package/dist/plugins/external-allowlist.js +11 -0
- package/dist/plugins/registry.d.ts +8 -1
- package/dist/plugins/registry.d.ts.map +1 -1
- package/dist/plugins/registry.js +22 -3
- package/dist/prolog/codec.d.ts.map +1 -1
- package/dist/prolog/codec.js +10 -20
- package/dist/public/impact/coverage-depth-quality.d.ts.map +1 -1
- package/dist/public/impact/coverage-depth-quality.js +32 -16
- package/dist/public/impact/full-kb-quality.d.ts +6 -0
- package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
- package/dist/public/impact/full-kb-quality.js +8 -3
- package/dist/public/impact/requirement-quality.d.ts.map +1 -1
- package/dist/public/impact/requirement-quality.js +56 -29
- package/dist/public/operations/catalog.d.ts +13 -3
- package/dist/public/operations/catalog.d.ts.map +1 -1
- package/dist/public/operations/check-executor.d.ts +6 -0
- package/dist/public/operations/check-executor.d.ts.map +1 -1
- package/dist/public/operations/check-executor.js +34 -2
- package/dist/public/operations/discovery-executors.d.ts +5 -1
- package/dist/public/operations/discovery-executors.d.ts.map +1 -1
- package/dist/public/operations/discovery-executors.js +65 -4
- package/dist/public/operations/evidence-floor.d.ts +8 -1
- package/dist/public/operations/evidence-floor.d.ts.map +1 -1
- package/dist/public/operations/evidence-floor.js +3 -4
- package/dist/public/operations/migration-plan.d.ts.map +1 -1
- package/dist/public/operations/migration-plan.js +41 -10
- package/dist/public/operations/node-ports.d.ts.map +1 -1
- package/dist/public/operations/node-ports.js +3 -1
- package/dist/public/operations/source-analysis-cache.d.ts +22 -0
- package/dist/public/operations/source-analysis-cache.d.ts.map +1 -0
- package/dist/public/operations/source-analysis-cache.js +157 -0
- package/dist/public/operations/specs/discovery.d.ts +7 -2
- package/dist/public/operations/specs/discovery.d.ts.map +1 -1
- package/dist/public/operations/specs/discovery.js +7 -2
- package/dist/public/operations/specs/mutation-schemas.d.ts +6 -1
- package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
- package/dist/public/operations/specs/upsert.d.ts +6 -1
- package/dist/public/operations/specs/upsert.d.ts.map +1 -1
- package/dist/public/operations/symbol-granularity-check.d.ts +3 -1
- package/dist/public/operations/symbol-granularity-check.d.ts.map +1 -1
- package/dist/public/operations/symbol-granularity-check.js +21 -7
- package/dist/public/proof-protocol.d.ts +6 -1
- package/dist/public/proof-protocol.d.ts.map +1 -1
- package/dist/public/proof-protocol.js +12 -3
- package/dist/public/proof-sources.d.ts +2 -0
- package/dist/public/proof-sources.d.ts.map +1 -1
- package/dist/public/proof-sources.js +32 -6
- package/dist/public/skills/kibi-bootstrap/SKILL.md +2 -2
- package/dist/public/skills/kibi-usage/SKILL.md +42 -3
- package/dist/public/skills/kibi-usage/resources/fact-lanes.md +34 -0
- package/dist/public/skills/kibi-usage/resources/proof.md +13 -5
- package/dist/public/skills/kibi-usage/resources/workflows.md +10 -0
- package/dist/relationships/shards.d.ts +2 -0
- package/dist/relationships/shards.d.ts.map +1 -1
- package/dist/relationships/shards.js +25 -1
- package/dist/schemas/entity.schema.json +6 -1
- package/dist/search-answer.js +1 -1
- package/dist/search-hints.d.ts +58 -0
- package/dist/search-hints.d.ts.map +1 -0
- package/dist/search-hints.js +187 -0
- package/dist/search-ranking.d.ts +7 -0
- package/dist/search-ranking.d.ts.map +1 -1
- package/dist/search-ranking.js +54 -56
- package/dist/search-token-cache.d.ts +30 -0
- package/dist/search-token-cache.d.ts.map +1 -0
- package/dist/search-token-cache.js +86 -0
- package/dist/usage-telemetry.d.ts +11 -0
- package/dist/usage-telemetry.d.ts.map +1 -0
- package/dist/usage-telemetry.js +47 -0
- package/dist/utils/branch-resolver.d.ts.map +1 -1
- package/dist/utils/branch-resolver.js +1 -0
- package/package.json +5 -4
- package/src/public/impact/coverage-depth-quality.ts +59 -21
- package/src/public/impact/full-kb-quality.ts +15 -1
- package/src/public/impact/requirement-quality.ts +95 -38
- package/src/public/operations/check-executor.ts +41 -1
- package/src/public/operations/discovery-executors.ts +92 -4
- package/src/public/operations/evidence-floor.ts +15 -3
- package/src/public/operations/migration-plan.ts +41 -9
- package/src/public/operations/node-ports.ts +3 -1
- package/src/public/operations/source-analysis-cache.ts +196 -0
- package/src/public/operations/specs/discovery.ts +8 -2
- package/src/public/operations/symbol-granularity-check.ts +25 -5
- package/src/public/proof-protocol-types.d.ts +1 -1
- package/src/public/proof-protocol.ts +18 -4
- package/src/public/proof-sources.ts +37 -6
- package/src/public/skills/kibi-bootstrap/SKILL.md +2 -2
- package/src/public/skills/kibi-usage/SKILL.md +42 -3
- package/src/public/skills/kibi-usage/resources/fact-lanes.md +34 -0
- package/src/public/skills/kibi-usage/resources/proof.md +13 -5
- package/src/public/skills/kibi-usage/resources/workflows.md +10 -0
- package/src/schemas/entity.schema.json +6 -1
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
You should have received a copy of the GNU Affero General Public License
|
|
16
16
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
|
-
import { spawnSync } from "node:child_process";
|
|
19
18
|
import { createHash } from "node:crypto";
|
|
20
19
|
import { existsSync, readFileSync } from "node:fs";
|
|
21
20
|
import { createRequire } from "node:module";
|
|
@@ -25,7 +24,7 @@ import { runOperationJsonQuery, toPrologAtom, } from "../../public/operations/pr
|
|
|
25
24
|
import { canonicalCertificateJson, certificateDigest, } from "../../public/proof-certificates.js";
|
|
26
25
|
import { CODE_CERTIFICATE_VERSION, isCertificateProofKind, } from "../../public/proof-protocol.js";
|
|
27
26
|
import { describeSource, normalizeSourceSpec, readSource, } from "../../public/proof-sources.js";
|
|
28
|
-
import { runCodeEvaluator, TS_RESOLVE_HOOKS, } from "./code-runner.js";
|
|
27
|
+
import { runCodeEvaluator, spawnSyncThroughFiles, TS_RESOLVE_HOOKS, } from "./code-runner.js";
|
|
29
28
|
import { evaluateSourceCode } from "./source-code-readers.js";
|
|
30
29
|
import { machineCertificateProblem, patternCertificateProblem, ruleCertificateProblem, } from "./code-models.js";
|
|
31
30
|
function record(value) {
|
|
@@ -64,7 +63,9 @@ const IMPORT_SPECIFIER = /(?:\bfrom\s*|\bimport\s*\(\s*|\bimport\s+|\brequire\s*
|
|
|
64
63
|
*/
|
|
65
64
|
// implements REQ-kibi-code-proof-kinds
|
|
66
65
|
export function importsDomain(source, sourcePath, targetPath, identifier, workspaceRoot) {
|
|
67
|
-
|
|
66
|
+
// A dotted export (BRAND.name) is imported under its head.
|
|
67
|
+
const imported = identifier.split(".")[0] ?? "";
|
|
68
|
+
if (imported === "" || !new RegExp(`\\b${escapeRegExp(imported)}\\b`).test(source))
|
|
68
69
|
return false;
|
|
69
70
|
const target = stripExtension(path.normalize(targetPath));
|
|
70
71
|
if (/\.py$/i.test(sourcePath))
|
|
@@ -203,21 +204,30 @@ function escapeRegExp(value) {
|
|
|
203
204
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
204
205
|
}
|
|
205
206
|
const DOMAIN_EVALUATOR = `
|
|
206
|
-
const [file, name] = process.argv.slice(-
|
|
207
|
+
const [file, name, projected] = process.argv.slice(-3);
|
|
207
208
|
const { pathToFileURL } = await import("node:url");
|
|
208
209
|
if (typeof globalThis.Bun === "undefined") {
|
|
209
210
|
const { register } = await import("node:module");
|
|
210
211
|
register?.("data:text/javascript," + encodeURIComponent(${JSON.stringify(TS_RESOLVE_HOOKS)}));
|
|
211
212
|
}
|
|
212
|
-
|
|
213
|
+
// A dotted name reads a field of the export (POLICY.eventLimit).
|
|
214
|
+
const [head, ...fields] = name.split(".");
|
|
215
|
+
let value = (await import(pathToFileURL(file).href))[head];
|
|
216
|
+
for (const field of fields) value = value !== null && typeof value === "object" ? value[field] : undefined;
|
|
213
217
|
let items = null;
|
|
214
218
|
if (Array.isArray(value)) items = value;
|
|
215
219
|
else if (value instanceof Set) items = [...value];
|
|
216
220
|
else if (value instanceof Map) items = [...value.keys()];
|
|
217
221
|
else if (value !== null && typeof value === "object") items = Object.keys(value);
|
|
222
|
+
// A field projects a list of records onto one field of each (catalog names).
|
|
223
|
+
if (projected !== "" && items !== null)
|
|
224
|
+
items = items.map((item) => (item !== null && typeof item === "object" ? item[projected] : undefined));
|
|
218
225
|
const primitive = (item) => ["string", "number", "boolean", "bigint"].includes(typeof item);
|
|
226
|
+
const unprojected = projected !== "" && items !== null && items.some((item) => item === undefined);
|
|
219
227
|
const scalar = typeof value === "number" || typeof value === "bigint" ? Number(value) : null;
|
|
220
|
-
console.log(JSON.stringify(
|
|
228
|
+
console.log(JSON.stringify(unprojected
|
|
229
|
+
? { error: \`a member of \${name} has no field \${projected}\` }
|
|
230
|
+
: scalar !== null
|
|
221
231
|
? { scalar }
|
|
222
232
|
: items === null
|
|
223
233
|
? { error: \`\${name} is not an array, set, map or object\` }
|
|
@@ -226,7 +236,7 @@ console.log(JSON.stringify(scalar !== null
|
|
|
226
236
|
// A Python domain: a list, tuple, set, frozenset, dict or Enum class.
|
|
227
237
|
const PYTHON_DOMAIN_EVALUATOR = `
|
|
228
238
|
import enum, importlib, json, os, sys
|
|
229
|
-
file, name = sys.argv[-2], sys.argv[-1]
|
|
239
|
+
file, name, projected = sys.argv[-3], sys.argv[-2], sys.argv[-1]
|
|
230
240
|
# Import the module under its package name, from the directory above its
|
|
231
241
|
# topmost package, so absolute and relative imports inside it resolve.
|
|
232
242
|
directory, module_name = os.path.split(os.path.splitext(file)[0])
|
|
@@ -236,7 +246,11 @@ while os.path.exists(os.path.join(directory, "__init__.py")):
|
|
|
236
246
|
parts.insert(0, package)
|
|
237
247
|
sys.path.insert(0, directory)
|
|
238
248
|
module = importlib.import_module(".".join(parts))
|
|
239
|
-
|
|
249
|
+
# A dotted name reads a field of the export (POLICY.event_limit).
|
|
250
|
+
head, *fields = name.split(".")
|
|
251
|
+
value = getattr(module, head, None)
|
|
252
|
+
for field in fields:
|
|
253
|
+
value = value.get(field) if isinstance(value, dict) else getattr(value, field, None)
|
|
240
254
|
if isinstance(value, type) and issubclass(value, enum.Enum):
|
|
241
255
|
items = [member.value for member in value]
|
|
242
256
|
elif isinstance(value, dict):
|
|
@@ -245,13 +259,18 @@ elif isinstance(value, (list, tuple, set, frozenset)):
|
|
|
245
259
|
items = list(value)
|
|
246
260
|
else:
|
|
247
261
|
items = None
|
|
262
|
+
# A field projects a list of records onto one field of each (catalog names).
|
|
263
|
+
if projected and items is not None:
|
|
264
|
+
items = [item.get(projected) if isinstance(item, dict) else getattr(item, projected, None) for item in items]
|
|
248
265
|
def primitive(item):
|
|
249
266
|
return isinstance(item, (str, int, float, bool))
|
|
250
267
|
def text(item):
|
|
251
268
|
if isinstance(item, bool):
|
|
252
269
|
return "true" if item else "false"
|
|
253
270
|
return str(item)
|
|
254
|
-
if
|
|
271
|
+
if projected and items is not None and any(item is None for item in items):
|
|
272
|
+
print(json.dumps({"error": f"a member of {name} has no field {projected}"}))
|
|
273
|
+
elif isinstance(value, (int, float)) and not isinstance(value, bool):
|
|
255
274
|
print(json.dumps({"scalar": value}))
|
|
256
275
|
elif items is None:
|
|
257
276
|
print(json.dumps({"error": f"{name} is not a list, tuple, set, dict or Enum"}))
|
|
@@ -293,7 +312,7 @@ export function evaluateScalar(workspaceRoot, sourceFile, exportName) {
|
|
|
293
312
|
}
|
|
294
313
|
function evaluateExport(workspaceRoot, sourceFile, exportName, options = {}) {
|
|
295
314
|
const absolute = path.resolve(workspaceRoot, sourceFile);
|
|
296
|
-
const run = runCodeEvaluator(workspaceRoot, sourceFile, { js: DOMAIN_EVALUATOR, python: PYTHON_DOMAIN_EVALUATOR }, [absolute, exportName], (parsed) => {
|
|
315
|
+
const run = runCodeEvaluator(workspaceRoot, sourceFile, { js: DOMAIN_EVALUATOR, python: PYTHON_DOMAIN_EVALUATOR }, [absolute, exportName, options.field ?? ""], (parsed) => {
|
|
297
316
|
const row = parsed;
|
|
298
317
|
return (row.error !== undefined ||
|
|
299
318
|
typeof row.scalar === "number" ||
|
|
@@ -668,9 +687,8 @@ export function rerunSmtQuery(solver, query) {
|
|
|
668
687
|
: null;
|
|
669
688
|
if (argv === null)
|
|
670
689
|
return { ok: false, reason: `solver ${solver} is not z3 or cvc5` };
|
|
671
|
-
const run =
|
|
690
|
+
const run = spawnSyncThroughFiles(solver, argv, {
|
|
672
691
|
input: query,
|
|
673
|
-
encoding: "utf8",
|
|
674
692
|
timeout: 60_000,
|
|
675
693
|
});
|
|
676
694
|
if (run.error)
|
|
@@ -678,7 +696,7 @@ export function rerunSmtQuery(solver, query) {
|
|
|
678
696
|
ok: false,
|
|
679
697
|
reason: `Kibi could not re-run ${solver} on the query: ${run.error.message}`,
|
|
680
698
|
};
|
|
681
|
-
const answer =
|
|
699
|
+
const answer = run.stdout.trim().split(/\s+/)[0] ?? "";
|
|
682
700
|
return answer === "unsat"
|
|
683
701
|
? { ok: true }
|
|
684
702
|
: {
|
|
@@ -711,7 +729,9 @@ async function workspaceProblem(context, contract, certificate) {
|
|
|
711
729
|
if (!importing)
|
|
712
730
|
return `the proof does not import ${exportName || domainId} from ${domain.sourceFile}, so its domain may be hand-listed${contract.domain_source?.export === undefined ? ` (Kibi reads the export named by the symbol's title; set domain_source.export when the export has another name)` : ""}`;
|
|
713
731
|
if (kind === "exhaustive") {
|
|
714
|
-
const evaluated = evaluateDomain(context.workspaceRoot, domain.sourceFile, exportName
|
|
732
|
+
const evaluated = evaluateDomain(context.workspaceRoot, domain.sourceFile, exportName, contract.domain_source?.field === undefined
|
|
733
|
+
? {}
|
|
734
|
+
: { field: contract.domain_source.field });
|
|
715
735
|
if (!evaluated.ok)
|
|
716
736
|
return evaluated.reason;
|
|
717
737
|
const members = record(certificate.domain)?.members;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-models.d.ts","sourceRoot":"","sources":["../../../src/operations/proof/code-models.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EACL,KAAK,YAAY,EAKlB,MAAM,uBAAuB,CAAC;AAM/B,8DAA8D;AAC9D,eAAO,MAAM,cAAc,SAAU,CAAC;AAGtC,MAAM,MAAM,QAAQ,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAExD,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAAC;IAC9B,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC;AAEH,2EAA2E;AAC3E,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAC;IAC/B,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;IACrD,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAA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EACvB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACnC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAoBxB;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAExD;AAED;;;;;;;;GAQG;AAEH,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAC7C,MAAM,EAAE,MAAM,GACb,MAAM,GAAG,IAAI,CAgDf"}
|
|
@@ -42,8 +42,14 @@ if (typeof globalThis.Bun === "undefined") {
|
|
|
42
42
|
const modules = new Map();
|
|
43
43
|
async function load(ref) {
|
|
44
44
|
if (!modules.has(ref.file)) modules.set(ref.file, await import(pathToFileURL(ref.file).href));
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
// A dotted name reads a field of the export (BRAND.name).
|
|
46
|
+
const [head, ...fields] = ref.export.split(".");
|
|
47
|
+
let value = modules.get(ref.file)[head];
|
|
48
|
+
if (value === undefined) throw new Error(head + " is not exported from " + ref.file);
|
|
49
|
+
for (const field of fields) {
|
|
50
|
+
value = value !== null && typeof value === "object" ? value[field] : undefined;
|
|
51
|
+
if (value === undefined) throw new Error(ref.export + " has no field " + field + " in " + ref.file);
|
|
52
|
+
}
|
|
47
53
|
return value;
|
|
48
54
|
}
|
|
49
55
|
function items(value, name) {
|
|
@@ -179,9 +185,17 @@ def module_for(file):
|
|
|
179
185
|
return modules[file]
|
|
180
186
|
def load(ref):
|
|
181
187
|
module = module_for(ref["file"])
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
188
|
+
# A dotted name reads a field of the export (BRAND.name).
|
|
189
|
+
head, *fields = ref["export"].split(".")
|
|
190
|
+
if not hasattr(module, head):
|
|
191
|
+
raise ValueError(head + " is not defined in " + ref["file"])
|
|
192
|
+
value = getattr(module, head)
|
|
193
|
+
missing = object()
|
|
194
|
+
for field in fields:
|
|
195
|
+
value = value.get(field, missing) if isinstance(value, dict) else getattr(value, field, missing)
|
|
196
|
+
if value is missing:
|
|
197
|
+
raise ValueError(ref["export"] + " has no field " + field + " in " + ref["file"])
|
|
198
|
+
return value
|
|
185
199
|
def text(item):
|
|
186
200
|
if isinstance(item, enum.Enum):
|
|
187
201
|
return text(item.value)
|
|
@@ -15,6 +15,22 @@ export declare function workspaceBin(workspaceRoot: string, name: string): strin
|
|
|
15
15
|
* project's dependencies, so a project environment comes before it.
|
|
16
16
|
*/
|
|
17
17
|
export declare function pythonDomainInterpreters(workspaceRoot: string, sourceFile: string, env?: NodeJS.ProcessEnv): string[];
|
|
18
|
+
/**
|
|
19
|
+
* spawnSync with the child's stdin, stdout and stderr in temp files instead
|
|
20
|
+
* of pipes. Bun can miss the readiness event of a child's pipe, which leaves
|
|
21
|
+
* a synchronous spawn waiting until its timeout although the child has long
|
|
22
|
+
* exited; with no pipes the call only waits for the process to exit.
|
|
23
|
+
*/
|
|
24
|
+
export declare function spawnSyncThroughFiles(command: string, args: readonly string[], options: Readonly<{
|
|
25
|
+
cwd?: string;
|
|
26
|
+
input?: string;
|
|
27
|
+
timeout: number;
|
|
28
|
+
}>): {
|
|
29
|
+
error: Error | undefined;
|
|
30
|
+
status: number | null;
|
|
31
|
+
stdout: string;
|
|
32
|
+
stderr: string;
|
|
33
|
+
};
|
|
18
34
|
/**
|
|
19
35
|
* Run an evaluator script against the workspace code and return the JSON it
|
|
20
36
|
* prints last. A TypeScript or JavaScript file runs with bun when it is on
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-runner.d.ts","sourceRoot":"","sources":["../../../src/operations/proof/code-runner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"code-runner.d.ts","sourceRoot":"","sources":["../../../src/operations/proof/code-runner.ts"],"names":[],"mappings":"AA+BA;;;;;;GAMG;AAKH,eAAO,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KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAgDlD"}
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
import { spawnSync } from "node:child_process";
|
|
19
|
-
import { existsSync } from "node:fs";
|
|
19
|
+
import { closeSync, existsSync, mkdtempSync, openSync, readFileSync, rmSync, writeFileSync, } from "node:fs";
|
|
20
|
+
import os from "node:os";
|
|
20
21
|
import path from "node:path";
|
|
21
22
|
/**
|
|
22
23
|
* How Kibi runs a small evaluator script against the workspace's own code:
|
|
@@ -92,6 +93,43 @@ export function pythonDomainInterpreters(workspaceRoot, sourceFile, env = proces
|
|
|
92
93
|
add("python");
|
|
93
94
|
return interpreters;
|
|
94
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* spawnSync with the child's stdin, stdout and stderr in temp files instead
|
|
98
|
+
* of pipes. Bun can miss the readiness event of a child's pipe, which leaves
|
|
99
|
+
* a synchronous spawn waiting until its timeout although the child has long
|
|
100
|
+
* exited; with no pipes the call only waits for the process to exit.
|
|
101
|
+
*/
|
|
102
|
+
export function spawnSyncThroughFiles(command, args, options) {
|
|
103
|
+
const dir = mkdtempSync(path.join(os.tmpdir(), "kibi-spawn-"));
|
|
104
|
+
try {
|
|
105
|
+
const inPath = path.join(dir, "stdin");
|
|
106
|
+
const outPath = path.join(dir, "stdout");
|
|
107
|
+
const errPath = path.join(dir, "stderr");
|
|
108
|
+
writeFileSync(inPath, options.input ?? "");
|
|
109
|
+
const fds = [openSync(inPath, "r"), openSync(outPath, "w"), openSync(errPath, "w")];
|
|
110
|
+
let run;
|
|
111
|
+
try {
|
|
112
|
+
run = spawnSync(command, [...args], {
|
|
113
|
+
cwd: options.cwd,
|
|
114
|
+
stdio: fds,
|
|
115
|
+
timeout: options.timeout,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
finally {
|
|
119
|
+
for (const fd of fds)
|
|
120
|
+
closeSync(fd);
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
error: run.error,
|
|
124
|
+
status: run.status,
|
|
125
|
+
stdout: readFileSync(outPath, "utf8"),
|
|
126
|
+
stderr: readFileSync(errPath, "utf8"),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
finally {
|
|
130
|
+
rmSync(dir, { recursive: true, force: true });
|
|
131
|
+
}
|
|
132
|
+
}
|
|
95
133
|
/** The line of a runner's stderr that names the failure. */
|
|
96
134
|
function failureLine(stderr, python) {
|
|
97
135
|
const lines = stderr
|
|
@@ -141,15 +179,13 @@ export function runCodeEvaluator(workspaceRoot, sourceFile, scripts, args, accep
|
|
|
141
179
|
});
|
|
142
180
|
let failure = "";
|
|
143
181
|
for (const [command, argv] of runners) {
|
|
144
|
-
const run =
|
|
182
|
+
const run = spawnSyncThroughFiles(command, [...argv, ...args], {
|
|
145
183
|
cwd: workspaceRoot,
|
|
146
|
-
encoding: "utf8",
|
|
147
184
|
timeout: 60_000,
|
|
148
|
-
maxBuffer: 64 * 1024 * 1024,
|
|
149
185
|
});
|
|
150
186
|
if (run.error)
|
|
151
187
|
continue;
|
|
152
|
-
const line =
|
|
188
|
+
const line = run.stdout.trim().split("\n").pop() ?? "";
|
|
153
189
|
try {
|
|
154
190
|
const parsed = JSON.parse(line);
|
|
155
191
|
if (accept(parsed))
|
|
@@ -158,7 +194,7 @@ export function runCodeEvaluator(workspaceRoot, sourceFile, scripts, args, accep
|
|
|
158
194
|
catch {
|
|
159
195
|
// Fall through to the next runner.
|
|
160
196
|
}
|
|
161
|
-
failure = failureLine(run.stderr
|
|
197
|
+
failure = failureLine(run.stderr, python);
|
|
162
198
|
}
|
|
163
199
|
return { ok: false, failure, python };
|
|
164
200
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type PluginProviderStamp, type SearchHint, type SearchHintsInput, type SearchHintsV1 } from "kibi-plugin-sdk";
|
|
2
|
+
import { type SemanticClassifierDiagnostic } from "./compose-semantic-classifier.js";
|
|
3
|
+
import type { CapabilityModeResolution, CapabilityProviderBinding } from "./registry.js";
|
|
4
|
+
export type SearchHintsDiagnostic = SemanticClassifierDiagnostic;
|
|
5
|
+
export type ComposedSearchHints = Readonly<{
|
|
6
|
+
/** Hints of the replace provider; empty without one or when it failed. */
|
|
7
|
+
hints: readonly SearchHint[];
|
|
8
|
+
/** Stamp of the provider whose hints are shown, if any. */
|
|
9
|
+
stamp: PluginProviderStamp | null;
|
|
10
|
+
shadowComparisons: readonly {
|
|
11
|
+
readonly stamp: PluginProviderStamp;
|
|
12
|
+
readonly hints: readonly SearchHint[];
|
|
13
|
+
}[];
|
|
14
|
+
fallbackUsed: boolean;
|
|
15
|
+
diagnostics: readonly SearchHintsDiagnostic[];
|
|
16
|
+
}>;
|
|
17
|
+
/**
|
|
18
|
+
* replace / shadow for search hints. The builtin has no hints, so without a
|
|
19
|
+
* replace provider nothing is shown; a failing or late replace provider
|
|
20
|
+
* yields no hints (stamped fallbackUsed) and a diagnostic, never an error.
|
|
21
|
+
* Shadow providers are recorded for comparison only. External providers run
|
|
22
|
+
* only for allowlisted operations.
|
|
23
|
+
*/
|
|
24
|
+
export declare function composeSearchHints(resolution: CapabilityModeResolution<SearchHintsV1>, input: SearchHintsInput, options: Readonly<{
|
|
25
|
+
operationName: string;
|
|
26
|
+
/** How long one provider may take to answer. */
|
|
27
|
+
timeoutMs: (binding: CapabilityProviderBinding<SearchHintsV1>) => number;
|
|
28
|
+
}>): Promise<ComposedSearchHints>;
|
|
29
|
+
//# sourceMappingURL=compose-search-hints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose-search-hints.d.ts","sourceRoot":"","sources":["../../src/plugins/compose-search-hints.ts"],"names":[],"mappings":"AAkBA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAEnB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,KAAK,4BAA4B,EAGlC,MAAM,kCAAkC,CAAC;AAE1C,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,eAAe,CAAC;AAGvB,MAAM,MAAM,qBAAqB,GAAG,4BAA4B,CAAC;AAGjE,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IACzC,0EAA0E;IAC1E,KAAK,EAAE,SAAS,UAAU,EAAE,CAAC;IAC7B,2DAA2D;IAC3D,KAAK,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAClC,iBAAiB,EAAE,SAAS;QAC1B,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAAC;QACpC,QAAQ,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,CAAC;KACvC,EAAE,CAAC;IACJ,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,SAAS,qBAAqB,EAAE,CAAC;CAC/C,CAAC,CAAC;AA+CH;;;;;;GAMG;AAEH,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,wBAAwB,CAAC,aAAa,CAAC,EACnD,KAAK,EAAE,gBAAgB,EACvB,OAAO,EAAE,QAAQ,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,SAAS,EAAE,CAAC,OAAO,EAAE,yBAAyB,CAAC,aAAa,CAAC,KAAK,MAAM,CAAC;CAC1E,CAAC,GACD,OAAO,CAAC,mBAAmB,CAAC,CAuC9B"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Kibi — repo-local, per-branch, queryable long-term memory for software projects
|
|
3
|
+
Copyright (C) 2026 Piotr Franczyk
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify
|
|
6
|
+
it under the terms of the GNU Affero General Public License as published by
|
|
7
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
(at your option) any later version.
|
|
9
|
+
|
|
10
|
+
This program is distributed in the hope that it will be useful,
|
|
11
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
GNU Affero General Public License for more details.
|
|
14
|
+
|
|
15
|
+
You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { validateSearchHintsResult, } from "kibi-plugin-sdk";
|
|
19
|
+
import { diagnosticFromError, withFallback, } from "./compose-semantic-classifier.js";
|
|
20
|
+
import { allowsExternalSearchHints } from "./external-allowlist.js";
|
|
21
|
+
/** A provider that does not answer within the deadline counts as failed. */
|
|
22
|
+
class SearchHintsTimeout extends Error {
|
|
23
|
+
code = "timeout";
|
|
24
|
+
constructor(ms) {
|
|
25
|
+
super(`search hints provider did not answer within ${ms} ms`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
async function ask(binding, input, timeoutMs) {
|
|
29
|
+
let timer;
|
|
30
|
+
try {
|
|
31
|
+
const answer = Promise.resolve(binding.capability.hint(input));
|
|
32
|
+
// rationale: clearing only frees the timer early; a timer left to fire
|
|
33
|
+
// rejects a race that already settled, which nothing observes.
|
|
34
|
+
// Stryker disable all
|
|
35
|
+
const clear = () => clearTimeout(timer);
|
|
36
|
+
answer.then(clear, clear);
|
|
37
|
+
// Stryker restore all
|
|
38
|
+
const result = await Promise.race([
|
|
39
|
+
answer,
|
|
40
|
+
new Promise((_, reject) => {
|
|
41
|
+
timer = setTimeout(() => reject(new SearchHintsTimeout(timeoutMs)), timeoutMs);
|
|
42
|
+
}),
|
|
43
|
+
]);
|
|
44
|
+
const validated = validateSearchHintsResult(result, input.entities.map((entity) => entity.id), input.limit);
|
|
45
|
+
return { ok: true, hints: validated.hints };
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
return { ok: false, diagnostic: diagnosticFromError(binding, error) };
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* replace / shadow for search hints. The builtin has no hints, so without a
|
|
53
|
+
* replace provider nothing is shown; a failing or late replace provider
|
|
54
|
+
* yields no hints (stamped fallbackUsed) and a diagnostic, never an error.
|
|
55
|
+
* Shadow providers are recorded for comparison only. External providers run
|
|
56
|
+
* only for allowlisted operations.
|
|
57
|
+
*/
|
|
58
|
+
// implements REQ-kibi-search-hints-host
|
|
59
|
+
export async function composeSearchHints(resolution, input, options) {
|
|
60
|
+
const empty = {
|
|
61
|
+
hints: [],
|
|
62
|
+
stamp: null,
|
|
63
|
+
shadowComparisons: [],
|
|
64
|
+
fallbackUsed: false,
|
|
65
|
+
diagnostics: [],
|
|
66
|
+
};
|
|
67
|
+
if (!allowsExternalSearchHints(options.operationName))
|
|
68
|
+
return empty;
|
|
69
|
+
const diagnostics = [];
|
|
70
|
+
let hints = [];
|
|
71
|
+
let stamp = null;
|
|
72
|
+
let fallbackUsed = false;
|
|
73
|
+
if (resolution.replace) {
|
|
74
|
+
const answer = await ask(resolution.replace, input, options.timeoutMs(resolution.replace));
|
|
75
|
+
if (answer.ok) {
|
|
76
|
+
hints = answer.hints;
|
|
77
|
+
stamp = resolution.replace.stamp;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
diagnostics.push(answer.diagnostic);
|
|
81
|
+
fallbackUsed = true;
|
|
82
|
+
stamp = withFallback(resolution.replace.stamp, true);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
const shadowComparisons = [];
|
|
86
|
+
for (const shadow of resolution.shadow) {
|
|
87
|
+
const answer = await ask(shadow, input, options.timeoutMs(shadow));
|
|
88
|
+
if (answer.ok)
|
|
89
|
+
shadowComparisons.push({ stamp: shadow.stamp, hints: answer.hints });
|
|
90
|
+
else
|
|
91
|
+
diagnostics.push(answer.diagnostic);
|
|
92
|
+
}
|
|
93
|
+
return { hints, stamp, shadowComparisons, fallbackUsed, diagnostics };
|
|
94
|
+
}
|
|
@@ -14,4 +14,11 @@ export declare function allowsExternalSemanticClassifier(operationName: string):
|
|
|
14
14
|
*/
|
|
15
15
|
export declare const EXTERNAL_VOCABULARY_ALIGNMENT_OPERATIONS: readonly ["kb_model_requirement"];
|
|
16
16
|
export declare function allowsExternalVocabularyAlignment(operationName: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Operations that may call external kibi.search-hints.v1 providers. Hints are
|
|
19
|
+
* advice next to a search answer; checks, proofs and every write stay
|
|
20
|
+
* builtin-only.
|
|
21
|
+
*/
|
|
22
|
+
export declare const EXTERNAL_SEARCH_HINTS_OPERATIONS: readonly ["kb_search"];
|
|
23
|
+
export declare function allowsExternalSearchHints(operationName: string): boolean;
|
|
17
24
|
//# sourceMappingURL=external-allowlist.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"external-allowlist.d.ts","sourceRoot":"","sources":["../../src/plugins/external-allowlist.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,uCAAuC,uDAG1C,CAAC;AAGX,MAAM,MAAM,mCAAmC,GAC7C,CAAC,OAAO,uCAAuC,CAAC,CAAC,MAAM,CAAC,CAAC;AAK3D,wBAAgB,gCAAgC,CAC9C,aAAa,EAAE,MAAM,GACpB,OAAO,CAET;AAED;;;;GAIG;AAEH,eAAO,MAAM,wCAAwC,mCAE3C,CAAC;AAGX,wBAAgB,iCAAiC,CAC/C,aAAa,EAAE,MAAM,GACpB,OAAO,CAIT"}
|
|
1
|
+
{"version":3,"file":"external-allowlist.d.ts","sourceRoot":"","sources":["../../src/plugins/external-allowlist.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,uCAAuC,uDAG1C,CAAC;AAGX,MAAM,MAAM,mCAAmC,GAC7C,CAAC,OAAO,uCAAuC,CAAC,CAAC,MAAM,CAAC,CAAC;AAK3D,wBAAgB,gCAAgC,CAC9C,aAAa,EAAE,MAAM,GACpB,OAAO,CAET;AAED;;;;GAIG;AAEH,eAAO,MAAM,wCAAwC,mCAE3C,CAAC;AAGX,wBAAgB,iCAAiC,CAC/C,aAAa,EAAE,MAAM,GACpB,OAAO,CAIT;AAED;;;;GAIG;AAEH,eAAO,MAAM,gCAAgC,wBAAyB,CAAC;AAGvE,wBAAgB,yBAAyB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAIxE"}
|
|
@@ -27,3 +27,14 @@ export const EXTERNAL_VOCABULARY_ALIGNMENT_OPERATIONS = [
|
|
|
27
27
|
export function allowsExternalVocabularyAlignment(operationName) {
|
|
28
28
|
return EXTERNAL_VOCABULARY_ALIGNMENT_OPERATIONS.includes(operationName);
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Operations that may call external kibi.search-hints.v1 providers. Hints are
|
|
32
|
+
* advice next to a search answer; checks, proofs and every write stay
|
|
33
|
+
* builtin-only.
|
|
34
|
+
*/
|
|
35
|
+
// implements REQ-kibi-search-hints-host
|
|
36
|
+
export const EXTERNAL_SEARCH_HINTS_OPERATIONS = ["kb_search"];
|
|
37
|
+
// implements REQ-kibi-search-hints-host
|
|
38
|
+
export function allowsExternalSearchHints(operationName) {
|
|
39
|
+
return EXTERNAL_SEARCH_HINTS_OPERATIONS.includes(operationName);
|
|
40
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CapabilityId, type KibiPluginV1, type OntologyPackV1, type PluginMode, type PluginPermissions, type PluginProviderStamp, type ProjectKibiConfig, type SemanticClassifierV1, type SymbolExtractorV1, type SymbolExtractorV2, type VocabularyAlignmentV1 } from "kibi-plugin-sdk";
|
|
1
|
+
import { type CapabilityId, type KibiPluginV1, type OntologyPackV1, type PluginMode, type PluginPermissions, type PluginProviderStamp, type ProjectKibiConfig, type SearchHintsV1, type SemanticClassifierV1, type SymbolExtractorV1, type SymbolExtractorV2, type VocabularyAlignmentV1 } from "kibi-plugin-sdk";
|
|
2
2
|
import { type LoadPluginOptions, loadPluginPackage } from "./load-plugin.js";
|
|
3
3
|
export type BuiltinPluginFactory = () => KibiPluginV1 | Promise<KibiPluginV1>;
|
|
4
4
|
export type CapabilityProviderBinding<T> = Readonly<{
|
|
@@ -32,6 +32,12 @@ export type CapabilityRegistryOptions = Readonly<{
|
|
|
32
32
|
loadPlugin?: (workspaceRoot: string, packageName: string, options?: LoadPluginOptions) => Promise<Awaited<ReturnType<typeof loadPluginPackage>>>;
|
|
33
33
|
loadPluginOptions?: LoadPluginOptions;
|
|
34
34
|
}>;
|
|
35
|
+
/**
|
|
36
|
+
* Search hints have no builtin answer: without a configured provider there
|
|
37
|
+
* are no hints. A builtin package that predates the capability resolves to
|
|
38
|
+
* this host no-op instead of failing the search.
|
|
39
|
+
*/
|
|
40
|
+
export declare const NO_SEARCH_HINTS: SearchHintsV1;
|
|
35
41
|
/**
|
|
36
42
|
* Minimal builtin used when no factory is injected and the builtin package is
|
|
37
43
|
* not yet wired. Satisfies kibi.plugin.v1 validation.
|
|
@@ -61,6 +67,7 @@ export declare class CapabilityRegistry {
|
|
|
61
67
|
resolveSymbolExtractors(): Promise<CapabilityModeResolution<SymbolExtractorV1>>;
|
|
62
68
|
resolveSymbolExtractorsV2(): Promise<CapabilityModeResolution<SymbolExtractorV2>>;
|
|
63
69
|
resolveVocabularyAlignment(): Promise<CapabilityModeResolution<VocabularyAlignmentV1>>;
|
|
70
|
+
resolveSearchHints(): Promise<CapabilityModeResolution<SearchHintsV1>>;
|
|
64
71
|
resolveCapability(capabilityId: CapabilityId): Promise<CapabilityModeResolution<unknown>>;
|
|
65
72
|
/**
|
|
66
73
|
* Canonical providers only (builtin + optional replace + augment).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/plugins/registry.ts"],"names":[],"mappings":"AAkBA,OAAO,EAGL,KAAK,YAAY,EAGjB,KAAK,YAAY,EAEjB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,mBAAm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KAAK,CAAC,EAAE,uBAAuB,CAAC;CAC1C,CAAC;AAEF;;;GAGG;AAEH,wBAAgB,wBAAwB,CACtC,sBAAsB,EAAE,MAAM,GAAG,+BAA+B,EAChE,OAAO,CAAC,EAAE,IAAI,CAAC,yBAAyB,EAAE,eAAe,CAAC,GAAG;IAC3D,QAAQ,CAAC,KAAK,CAAC,EAAE,uBAAuB,CAAC;CAC1C,GACA,kBAAkB,CAoBpB"}
|
package/dist/plugins/registry.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
You should have received a copy of the GNU Affero General Public License
|
|
16
16
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
|
-
import { CHECK_POLICY_CAPABILITY_ID, CHECK_POLICY_CONTRACT_VERSION, KIBI_PLUGIN_API_VERSION, ONTOLOGY_PACK_CAPABILITY_ID, SEMANTIC_CLASSIFIER_CAPABILITY_ID, SYMBOL_EXTRACTOR_CAPABILITY_ID, SYMBOL_EXTRACTOR_V2_CAPABILITY_ID, VOCABULARY_ALIGNMENT_CAPABILITY_ID, defineKibiPlugin, validateKibiPlugin, } from "kibi-plugin-sdk";
|
|
18
|
+
import { CHECK_POLICY_CAPABILITY_ID, CHECK_POLICY_CONTRACT_VERSION, KIBI_PLUGIN_API_VERSION, ONTOLOGY_PACK_CAPABILITY_ID, SEARCH_HINTS_CAPABILITY_ID, SEMANTIC_CLASSIFIER_CAPABILITY_ID, SYMBOL_EXTRACTOR_CAPABILITY_ID, SYMBOL_EXTRACTOR_V2_CAPABILITY_ID, VOCABULARY_ALIGNMENT_CAPABILITY_ID, defineKibiPlugin, validateKibiPlugin, } from "kibi-plugin-sdk";
|
|
19
19
|
import { loadPluginPackage } from "./load-plugin.js";
|
|
20
20
|
import { readProjectKibiConfig } from "./project-config.js";
|
|
21
21
|
import { PluginResolutionError } from "./resolve-package.js";
|
|
@@ -26,6 +26,18 @@ const CAPABILITY_SLOT = {
|
|
|
26
26
|
[SYMBOL_EXTRACTOR_V2_CAPABILITY_ID]: "symbolExtractorV2",
|
|
27
27
|
[VOCABULARY_ALIGNMENT_CAPABILITY_ID]: "vocabularyAlignment",
|
|
28
28
|
[CHECK_POLICY_CAPABILITY_ID]: "checkPolicy",
|
|
29
|
+
[SEARCH_HINTS_CAPABILITY_ID]: "searchHints",
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Search hints have no builtin answer: without a configured provider there
|
|
33
|
+
* are no hints. A builtin package that predates the capability resolves to
|
|
34
|
+
* this host no-op instead of failing the search.
|
|
35
|
+
*/
|
|
36
|
+
// implements REQ-kibi-search-hints-host
|
|
37
|
+
export const NO_SEARCH_HINTS = {
|
|
38
|
+
id: "kibi-host.search-hints.none",
|
|
39
|
+
model: "none",
|
|
40
|
+
hint: () => ({ hints: [] }),
|
|
29
41
|
};
|
|
30
42
|
/**
|
|
31
43
|
* Minimal builtin used when no factory is injected and the builtin package is
|
|
@@ -214,6 +226,10 @@ export class CapabilityRegistry {
|
|
|
214
226
|
async resolveVocabularyAlignment() {
|
|
215
227
|
return this.resolveCapability(VOCABULARY_ALIGNMENT_CAPABILITY_ID);
|
|
216
228
|
}
|
|
229
|
+
// implements REQ-kibi-search-hints-host
|
|
230
|
+
async resolveSearchHints() {
|
|
231
|
+
return this.resolveCapability(SEARCH_HINTS_CAPABILITY_ID);
|
|
232
|
+
}
|
|
217
233
|
async resolveCapability(capabilityId) {
|
|
218
234
|
const cached = this.capabilityCache.get(capabilityId);
|
|
219
235
|
if (cached)
|
|
@@ -240,7 +256,10 @@ export class CapabilityRegistry {
|
|
|
240
256
|
}
|
|
241
257
|
async buildCapabilityResolution(capabilityId) {
|
|
242
258
|
const builtinPlugin = await this.getBuiltinPlugin();
|
|
243
|
-
const builtinCapability = capabilityFromPlugin(builtinPlugin, capabilityId)
|
|
259
|
+
const builtinCapability = capabilityFromPlugin(builtinPlugin, capabilityId) ??
|
|
260
|
+
(capabilityId === SEARCH_HINTS_CAPABILITY_ID
|
|
261
|
+
? NO_SEARCH_HINTS
|
|
262
|
+
: undefined);
|
|
244
263
|
if (!builtinCapability) {
|
|
245
264
|
throw new PluginResolutionError("BUILTIN_MISSING_CAPABILITY", `Builtin plugin '${builtinPlugin.id}' does not provide ${capabilityId}`);
|
|
246
265
|
}
|
|
@@ -255,7 +274,7 @@ export class CapabilityRegistry {
|
|
|
255
274
|
[builtinPlugin.id, "kibi-plugin-builtin"],
|
|
256
275
|
]);
|
|
257
276
|
const providerIds = new Set([
|
|
258
|
-
|
|
277
|
+
builtinCapability.id ?? builtinPlugin.id,
|
|
259
278
|
]);
|
|
260
279
|
for (const entry of relevant) {
|
|
261
280
|
const modeConfig = entry.capabilities[capabilityId];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../src/prolog/codec.ts"],"names":[],"mappings":"AAUA;;;GAGG;AAEH;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAYhD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIlD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CASpD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGvD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,CAU5D;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,GACrC,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAO9B;AAED,wBAAgB,uBAAuB,CAAC,CAAC,EACvC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EAClC,QAAQ,EAAE,CAAC,GACV,CAAC,GAAG,IAAI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