@modality-counter/core 2.6.0 → 2.7.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.
@@ -23,6 +23,8 @@ export declare function buildReferenceInstructions(referenceList: MethodReferenc
23
23
  export interface ReferenceOptions {
24
24
  /** Build the call-syntax shown in the directive for a given method id. */
25
25
  buildInvocation?: (methodId: string) => string;
26
+ /** Bare CLI command name (e.g. `skill`), handed to the method's script as `context.command`. */
27
+ command?: string;
26
28
  }
27
29
  export declare function buildReferences(folderPath: string | undefined, methodId: string, options?: ReferenceOptions): Promise<{
28
30
  referenceInstruction: string;
@@ -6,10 +6,10 @@ export { DEPLOY_METHOD_TOOL } from "./confs/const.js";
6
6
  */
7
7
  export { DeepWiki } from "./util_scripts/DeepWiki";
8
8
  export { getPagination, needsChunking, getChunk, } from "./util_scripts/pagination";
9
- export { getCounterContent, getAllCounterItems, type CounterContent, type CounterTuple, } from "./util_counter_data";
9
+ export { getCounterContent, getAllCounterItems, type CounterContent, type CounterScriptContext, type CounterTuple, } from "./util_counter_data";
10
10
  export { setupMcpCounter } from "./mcp_counter";
11
11
  export { executeMethod } from "./execute_method";
12
- export { toCounterCLI } from "./toCounterCLI";
12
+ export { toCounterCLI, type CliOptions } from "./toCounterCLI";
13
13
  export { toCounterCLIHelp, toCounterMethodHelp, type HelpFormat } from "./toCounterCLIHelp";
14
14
  export { validateMethodFile, MethodFileSchema } from "./schemas/methodology-validation.js";
15
15
  export { validateTemplateFile, TemplateFileSchema } from "./schemas/template-validation.js";
@@ -1 +1,11 @@
1
- export declare function toCounterCLI(baseDir: string, commandName?: string): (args: string[]) => Promise<void>;
1
+ export interface CliOptions {
2
+ cliName?: string;
3
+ command?: string;
4
+ }
5
+ /**
6
+ * @deprecated Pass an options object — `toCounterCLI(baseDir, { cliName, command })`.
7
+ * The pre-2.7 positional form is kept for existing callers and delegates to the
8
+ * object path; it will be removed once downstream callers have migrated.
9
+ */
10
+ export declare function toCounterCLI(baseDir: string, legacyName: string): (args: string[]) => Promise<void>;
11
+ export declare function toCounterCLI(baseDir: string, options?: CliOptions): (args: string[]) => Promise<void>;
@@ -44,10 +44,24 @@ export declare const getNormalizedName: (name: string, counterType?: string, sta
44
44
  resolveParams?: undefined;
45
45
  resolveName: string;
46
46
  };
47
+ /**
48
+ * Execution context Counter merges into the single props argument of
49
+ * `counterScript` as `props._ctx`.
50
+ */
51
+ export interface CounterScriptContext {
52
+ /** Method name exactly as the caller passed it (raw: keeps a leading `*` and original casing). */
53
+ method: string;
54
+ /** Bare CLI command name (e.g. `skill`). Undefined for MCP tool-call execution. */
55
+ command?: string;
56
+ /** Prompt-side result tuple Counter built before the script runs (the `returnContext` in executeMethod). */
57
+ returnContext?: CounterTuple;
58
+ }
47
59
  /** Resolved Counter content: prompt data, optional script, and party mode flag */
48
60
  export interface CounterContent {
49
61
  promptData: Record<string, any>;
50
- counterScript?(props: any, willReturn?: CounterTuple): any;
62
+ counterScript?(props: any & {
63
+ _ctx?: CounterScriptContext;
64
+ }): any;
51
65
  partyMode?: string;
52
66
  }
53
67
  export declare function getCounterContent(items: CounterItem[], callSign: string, params?: any, executeScript?: boolean, options?: ReferenceOptions): Promise<CounterContent | false>;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.6.0",
2
+ "version": "2.7.1",
3
3
  "name": "@modality-counter/core",
4
4
  "repository": {
5
5
  "type": "git",