@modality-counter/core 2.7.0 → 2.8.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.
@@ -61,12 +61,12 @@ export declare const workflowDeploySchema: z.ZodObject<{
61
61
  name: z.ZodString;
62
62
  }, z.core.$strip>;
63
63
  export type WorkflowDeployType = z.infer<typeof workflowDeploySchema>;
64
- export declare const counterAssembleSchema: z.ZodObject<{
64
+ export declare const counterAssembleSchema: z.ZodPreprocess<z.ZodObject<{
65
65
  types: z.ZodDefault<z.ZodArray<z.ZodEnum<{
66
66
  method: "method";
67
67
  persona: "persona";
68
68
  workflow: "workflow";
69
69
  }>>>;
70
70
  keyword: z.ZodDefault<z.ZodNullable<z.ZodString>>;
71
- }, z.core.$strip>;
71
+ }, z.core.$strip>, unknown>;
72
72
  export type CounterAssembleType = z.infer<typeof counterAssembleSchema>;
@@ -45,25 +45,23 @@ export declare const getNormalizedName: (name: string, counterType?: string, sta
45
45
  resolveName: string;
46
46
  };
47
47
  /**
48
- * Execution context Counter hands to a method script as the THIRD argument of
49
- * `counterScript`.
50
- *
51
- * NOTE ON ARG POSITION: `modality-mcp-kit` types `AITool.execute(args, context?)`
52
- * — context is the SECOND parameter there. Counter's `counterScript` contract
53
- * puts the result tuple second and this context third. Scripts must follow
54
- * Counter's order; one typed against the mcp-kit signature reads the result
55
- * tuple as its context.
48
+ * Execution context Counter merges into the single props argument of
49
+ * `counterScript` as `props._ctx`.
56
50
  */
57
51
  export interface CounterScriptContext {
58
52
  /** Method name exactly as the caller passed it (raw: keeps a leading `*` and original casing). */
59
53
  method: string;
60
54
  /** Bare CLI command name (e.g. `skill`). Undefined for MCP tool-call execution. */
61
55
  command?: string;
56
+ /** Prompt-side result tuple Counter built before the script runs (the `returnContext` in executeMethod). */
57
+ returnContext?: CounterTuple;
62
58
  }
63
59
  /** Resolved Counter content: prompt data, optional script, and party mode flag */
64
60
  export interface CounterContent {
65
61
  promptData: Record<string, any>;
66
- counterScript?(props: any, willReturn?: CounterTuple, context?: CounterScriptContext): any;
62
+ counterScript?(props: any & {
63
+ _ctx?: CounterScriptContext;
64
+ }): any;
67
65
  partyMode?: string;
68
66
  }
69
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.7.0",
2
+ "version": "2.8.0",
3
3
  "name": "@modality-counter/core",
4
4
  "repository": {
5
5
  "type": "git",