@gmickel/gno 0.20.0 → 0.22.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.
- package/README.md +9 -1
- package/package.json +34 -1
- package/src/cli/commands/ask.ts +1 -0
- package/src/cli/program.ts +17 -0
- package/src/pipeline/expansion.ts +27 -4
package/README.md
CHANGED
|
@@ -32,7 +32,15 @@ GNO is a local knowledge engine that turns your documents into a searchable, con
|
|
|
32
32
|
|
|
33
33
|
---
|
|
34
34
|
|
|
35
|
-
## What's New in v0.
|
|
35
|
+
## What's New in v0.21
|
|
36
|
+
|
|
37
|
+
- **Ask CLI Query Modes**: `gno ask` now accepts repeatable `--query-mode term|intent|hyde` entries, matching the existing Ask API and Web controls
|
|
38
|
+
|
|
39
|
+
### v0.20
|
|
40
|
+
|
|
41
|
+
- **Improved Model Init Fallbacks**: upgraded `node-llama-cpp` to `3.17.1` and switched to `build: "autoAttempt"` for better backend selection/fallback behavior
|
|
42
|
+
|
|
43
|
+
### v0.19
|
|
36
44
|
|
|
37
45
|
- **Exclusion Filters**: explicit `exclude` controls across CLI, API, Web, and MCP to hard-prune unwanted docs by title/path/body text
|
|
38
46
|
- **Ask Query-Mode Parity**: Ask now supports structured `term` / `intent` / `hyde` controls in both API and Web UI
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gmickel/gno",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.1",
|
|
4
4
|
"description": "Local semantic search for your documents. Index Markdown, PDF, and Office files with hybrid BM25 + vector search.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"embeddings",
|
|
@@ -54,7 +54,40 @@
|
|
|
54
54
|
"eval:hybrid": "bun --bun evalite evals/hybrid.eval.ts",
|
|
55
55
|
"eval:hybrid:baseline": "bun scripts/hybrid-benchmark.ts --write",
|
|
56
56
|
"eval:hybrid:delta": "bun scripts/hybrid-benchmark.ts --delta",
|
|
57
|
+
"eval:retrieval-candidates": "bun scripts/retrieval-candidate-benchmark.ts",
|
|
58
|
+
"eval:retrieval-candidates:write": "bun scripts/retrieval-candidate-benchmark.ts --write",
|
|
57
59
|
"eval:watch": "bun --bun evalite watch",
|
|
60
|
+
"research:finetune:bootstrap": "bun research/finetune/scripts/bootstrap-promotion-fixtures.ts",
|
|
61
|
+
"research:finetune:autonomous:noop": "bun research/finetune/autonomous/scripts/noop-run.ts",
|
|
62
|
+
"research:finetune:autonomous:evaluate": "bun research/finetune/autonomous/scripts/evaluate-run.ts",
|
|
63
|
+
"research:finetune:autonomous:propose-mix-variants": "bun research/finetune/autonomous/scripts/propose-mix-variants.ts",
|
|
64
|
+
"research:finetune:autonomous:list-search-candidates": "bun research/finetune/autonomous/scripts/list-search-candidates.ts",
|
|
65
|
+
"research:finetune:autonomous:run-candidate": "bun research/finetune/autonomous/scripts/run-candidate.ts",
|
|
66
|
+
"research:finetune:autonomous:search": "bun research/finetune/autonomous/scripts/search.ts",
|
|
67
|
+
"research:finetune:autonomous:leaderboard": "bun research/finetune/autonomous/scripts/leaderboard.ts",
|
|
68
|
+
"research:finetune:autonomous:confirm-winner": "bun research/finetune/autonomous/scripts/confirm-winner.ts",
|
|
69
|
+
"research:finetune:autonomous:check-promotion-targets": "bun research/finetune/autonomous/scripts/check-promotion-targets.ts",
|
|
70
|
+
"research:finetune:validate": "bun research/finetune/scripts/validate-sandbox.ts",
|
|
71
|
+
"research:finetune:qmd-import": "bun research/finetune/scripts/import-qmd-training.ts",
|
|
72
|
+
"research:finetune:mlx:build-dataset": "bun research/finetune/scripts/build-mlx-dataset.ts",
|
|
73
|
+
"research:finetune:build-variant-dataset": "bun research/finetune/scripts/build-variant-dataset.ts",
|
|
74
|
+
"research:finetune:list-mix-variants": "bun research/finetune/scripts/list-mix-variants.ts",
|
|
75
|
+
"research:finetune:list-prompt-variants": "bun research/finetune/scripts/list-prompt-variants.ts",
|
|
76
|
+
"research:finetune:export-env": "bun research/finetune/scripts/setup-export-env.ts",
|
|
77
|
+
"research:finetune:export-gguf": "bun research/finetune/scripts/export-gguf.ts",
|
|
78
|
+
"research:finetune:smoke-gno-export": "bun research/finetune/scripts/smoke-gno-export.ts",
|
|
79
|
+
"research:finetune:select-best": "bun research/finetune/scripts/select-best-checkpoint.ts",
|
|
80
|
+
"research:finetune:fuse-best": "bun research/finetune/scripts/fuse-best-checkpoint.ts",
|
|
81
|
+
"research:finetune:benchmark-export": "bun research/finetune/scripts/benchmark-exported-model.ts",
|
|
82
|
+
"research:finetune:repeat-benchmark-compare": "bun research/finetune/scripts/repeat-benchmark-compare.ts",
|
|
83
|
+
"research:finetune:compare-runs": "bun research/finetune/scripts/compare-runs.ts",
|
|
84
|
+
"research:finetune:promotion-bundle": "bun research/finetune/scripts/generate-promotion-bundle.ts",
|
|
85
|
+
"research:finetune:finalize": "bun research/finetune/scripts/finalize-promoted-model.ts",
|
|
86
|
+
"research:finetune:promote": "bun research/finetune/scripts/promote-run.ts",
|
|
87
|
+
"research:finetune:plan-sweep": "bun research/finetune/scripts/plan-alternate-sweep.ts",
|
|
88
|
+
"research:finetune:mlx:train": "bun research/finetune/scripts/train-mlx.ts",
|
|
89
|
+
"research:finetune:mlx:fuse": "bun research/finetune/scripts/fuse-mlx.ts",
|
|
90
|
+
"research:finetune:mlx:smoke": "bun research/finetune/scripts/smoke-mlx.ts",
|
|
58
91
|
"reset": "bun run src/index.ts reset --confirm",
|
|
59
92
|
"docs:verify": "bun run scripts/docs-verify.ts",
|
|
60
93
|
"website:install": "cd website && bundle install",
|
package/src/cli/commands/ask.ts
CHANGED
|
@@ -200,6 +200,7 @@ export async function ask(
|
|
|
200
200
|
tagsAll: options.tagsAll,
|
|
201
201
|
tagsAny: options.tagsAny,
|
|
202
202
|
exclude: options.exclude,
|
|
203
|
+
queryModes: options.queryModes,
|
|
203
204
|
noExpand: options.noExpand,
|
|
204
205
|
noRerank: options.noRerank,
|
|
205
206
|
candidateLimit: options.candidateLimit,
|
package/src/cli/program.ts
CHANGED
|
@@ -608,6 +608,12 @@ function wireSearchCommands(program: Command): void {
|
|
|
608
608
|
"--exclude <values>",
|
|
609
609
|
"exclude docs containing any term (comma-separated)"
|
|
610
610
|
)
|
|
611
|
+
.option(
|
|
612
|
+
"--query-mode <mode:text>",
|
|
613
|
+
"structured mode entry (repeatable): term:<text>, intent:<text>, or hyde:<text>",
|
|
614
|
+
(value: string, previous: string[] = []) => [...previous, value],
|
|
615
|
+
[]
|
|
616
|
+
)
|
|
611
617
|
.option("--fast", "skip expansion and reranking (fastest)")
|
|
612
618
|
.option("--thorough", "enable query expansion (slower)")
|
|
613
619
|
.option("-C, --candidate-limit <num>", "max candidates passed to reranking")
|
|
@@ -640,6 +646,16 @@ function wireSearchCommands(program: Command): void {
|
|
|
640
646
|
const categories = parseCsvValues(cmdOpts.category);
|
|
641
647
|
const exclude = parseCsvValues(cmdOpts.exclude);
|
|
642
648
|
|
|
649
|
+
let queryModes: import("../pipeline/types").QueryModeInput[] | undefined;
|
|
650
|
+
if (Array.isArray(cmdOpts.queryMode) && cmdOpts.queryMode.length > 0) {
|
|
651
|
+
const { parseQueryModeSpecs } = await import("../pipeline/query-modes");
|
|
652
|
+
const parsed = parseQueryModeSpecs(cmdOpts.queryMode as string[]);
|
|
653
|
+
if (!parsed.ok) {
|
|
654
|
+
throw new CliError("VALIDATION", parsed.error.message);
|
|
655
|
+
}
|
|
656
|
+
queryModes = parsed.value;
|
|
657
|
+
}
|
|
658
|
+
|
|
643
659
|
// Determine expansion/rerank settings based on flags
|
|
644
660
|
// Default: skip expansion (balanced mode)
|
|
645
661
|
let noExpand = true;
|
|
@@ -665,6 +681,7 @@ function wireSearchCommands(program: Command): void {
|
|
|
665
681
|
author: cmdOpts.author as string | undefined,
|
|
666
682
|
intent: cmdOpts.intent as string | undefined,
|
|
667
683
|
exclude,
|
|
684
|
+
queryModes,
|
|
668
685
|
noExpand,
|
|
669
686
|
noRerank,
|
|
670
687
|
candidateLimit,
|
|
@@ -421,6 +421,30 @@ function parseExpansionResult(output: string): ExpansionResult | null {
|
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
423
|
|
|
424
|
+
/**
|
|
425
|
+
* Build the exact expansion prompt used by production query expansion.
|
|
426
|
+
* Exported for benchmark/eval harnesses that need to inspect raw model output.
|
|
427
|
+
*/
|
|
428
|
+
export function buildExpansionPrompt(
|
|
429
|
+
query: string,
|
|
430
|
+
options: Pick<ExpansionOptions, "lang" | "intent"> = {}
|
|
431
|
+
): string {
|
|
432
|
+
const template = getPromptTemplate(options.lang);
|
|
433
|
+
return buildPrompt(query, template, options.intent);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* Parse raw expansion output using the same schema + guardrails as production.
|
|
438
|
+
* Exported for benchmark/eval harnesses that need raw-model diagnostics.
|
|
439
|
+
*/
|
|
440
|
+
export function parseExpansionOutput(
|
|
441
|
+
output: string,
|
|
442
|
+
query: string
|
|
443
|
+
): ExpansionResult | null {
|
|
444
|
+
const parsed = parseExpansionResult(output);
|
|
445
|
+
return parsed ? applyExpansionGuardrails(query, parsed) : null;
|
|
446
|
+
}
|
|
447
|
+
|
|
424
448
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
425
449
|
// Expansion Function
|
|
426
450
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
@@ -448,8 +472,7 @@ export async function expandQuery(
|
|
|
448
472
|
const timeout = options.timeout ?? DEFAULT_TIMEOUT_MS;
|
|
449
473
|
|
|
450
474
|
// Build prompt
|
|
451
|
-
const
|
|
452
|
-
const prompt = buildPrompt(query, template, options.intent);
|
|
475
|
+
const prompt = buildExpansionPrompt(query, options);
|
|
453
476
|
|
|
454
477
|
// Run with timeout (clear timer to avoid resource leak)
|
|
455
478
|
let timeoutId: ReturnType<typeof setTimeout> | undefined;
|
|
@@ -484,11 +507,11 @@ export async function expandQuery(
|
|
|
484
507
|
}
|
|
485
508
|
|
|
486
509
|
// Parse result
|
|
487
|
-
const parsed =
|
|
510
|
+
const parsed = parseExpansionOutput(result.value, query);
|
|
488
511
|
if (!parsed) {
|
|
489
512
|
return ok(null);
|
|
490
513
|
}
|
|
491
|
-
return ok(
|
|
514
|
+
return ok(parsed);
|
|
492
515
|
} catch {
|
|
493
516
|
if (timeoutId) {
|
|
494
517
|
clearTimeout(timeoutId);
|