membot 0.3.0 → 0.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "membot",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Versioned context store with hybrid search for AI agents. Stdio + HTTP MCP server and CLI.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { HelpfulError } from "../errors.ts";
2
3
  import { embedSingle } from "../ingest/embedder.ts";
3
4
  import { colors } from "../output/formatter.ts";
4
5
  import { fuseRRF } from "../search/hybrid.ts";
@@ -52,6 +53,14 @@ export const searchOperation = defineOperation({
52
53
  const query = input.query ?? input.pattern ?? "";
53
54
  const pattern = input.pattern ?? input.query ?? "";
54
55
 
56
+ if (!query.trim() && !pattern.trim()) {
57
+ throw new HelpfulError({
58
+ kind: "input_error",
59
+ message: "search requires a query or pattern",
60
+ hint: 'Pass a natural-language query (e.g. `membot search "oauth flow"`) or a keyword pattern (e.g. `membot search --pattern OAuth`).',
61
+ });
62
+ }
63
+
55
64
  const semanticHits =
56
65
  input.mode === "keyword" || !query.trim()
57
66
  ? []