@modality-counter/core 1.4.6 → 1.5.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.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -9,11 +9,18 @@ export declare const partyModeSchema: z.ZodObject<{
9
9
  }, z.core.$strip>;
10
10
  export type PartyMode = z.infer<typeof partyModeSchema>;
11
11
  /**
12
- * HACK: some MCP clients (e.g. certain Gemini tool runtimes) flatten a nested
13
- * `params` object into dotted top-level keys on the wire — sending
12
+ * DO NOT REMOVE — LLM AGENT INSTRUCTION.
13
+ *
14
+ * HACK: some MCP clients (e.g. certain Gemini tool runtimes, Copilot CLI) flatten
15
+ * a nested `params` object into dotted top-level keys on the wire — sending
14
16
  * `{ "params.reference": "x" }` instead of `{ params: { reference: "x" } }`.
15
17
  * Fold any `params.*` keys back into a nested `params` object so downstream
16
18
  * code (and Zod's object-strip) sees the intended shape instead of dropping it.
19
+ *
20
+ * This function is required by Copilot CLI and similar MCP clients. Removing it
21
+ * will break reference loading and method execution for those clients.
22
+ * NEVER remove this function or the z.preprocess(liftDottedParams, …) wrapper
23
+ * on heroMethodSchema.
17
24
  */
18
25
  export declare function liftDottedParams(input: unknown): unknown;
19
26
  export declare const heroMethodSchema: z.ZodPreprocess<z.ZodObject<{
@@ -35,5 +42,6 @@ export declare const counterAssembleSchema: z.ZodObject<{
35
42
  method: "method";
36
43
  workflow: "workflow";
37
44
  }>>>;
45
+ keyword: z.ZodDefault<z.ZodNullable<z.ZodString>>;
38
46
  }, z.core.$strip>;
39
47
  export type CounterAssembleType = z.infer<typeof counterAssembleSchema>;
@@ -54,6 +54,11 @@ export interface CounterContent {
54
54
  }
55
55
  export declare function getCounterContent(items: CounterItem[], callSign: string, params?: any, executeScript?: boolean, options?: ReferenceOptions): Promise<CounterContent | false>;
56
56
  export declare function getAllCounterItems(types?: ResourceType[], baseDir?: string): Promise<CounterItem[]>;
57
+ /**
58
+ * Fuzzy-search Counter items by keyword over their id, name and description.
59
+ * Returns matches ordered by relevance score (highest first).
60
+ */
61
+ export declare function searchCounterItems(items: CounterItem[], keyword: string): CounterItem[];
57
62
  /**
58
63
  * Find all template files - convenience wrapper around recursiveScanForFiles
59
64
  */
@@ -0,0 +1,36 @@
1
+ export interface FuzzyFinderOptions {
2
+ caseSensitive?: boolean;
3
+ sortByScore?: boolean;
4
+ tokenize?: boolean;
5
+ locale?: string;
6
+ }
7
+ export interface ScoreResult {
8
+ score: number;
9
+ matches: number[];
10
+ }
11
+ export interface SearchResultItem<T extends {
12
+ content: string;
13
+ }> {
14
+ item: T;
15
+ score: number;
16
+ matches: number[];
17
+ tokens: string[];
18
+ }
19
+ declare class FuzzyFinder<T extends {
20
+ content: string;
21
+ }> {
22
+ items: T[];
23
+ caseSensitive: boolean;
24
+ sortByScore: boolean;
25
+ tokenize: boolean;
26
+ locale: string;
27
+ constructor(items: T[], options?: FuzzyFinderOptions);
28
+ getTokens(query: string): string[];
29
+ scoreToken(item: string, token: string): ScoreResult | null;
30
+ score(item: string, query: string): ScoreResult | null;
31
+ isWordBoundary(str: string, idx: number): boolean;
32
+ getExactMatches(str: string, query: string): number[];
33
+ search(query: string): SearchResultItem<T>[];
34
+ highlight(item: string, matches: number[], openTag?: string, closeTag?: string): string;
35
+ }
36
+ export default FuzzyFinder;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.4.6",
2
+ "version": "1.5.0",
3
3
  "name": "@modality-counter/core",
4
4
  "repository": {
5
5
  "type": "git",