@modality-counter/core 2.9.1 → 2.9.4

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 {};
@@ -14,12 +14,6 @@ export { toCounterCLIHelp, toCounterMethodHelp, type HelpFormat } from "./toCoun
14
14
  export { validateMethodFile, MethodFileSchema } from "./schemas/methodology-validation.js";
15
15
  export { validateTemplateFile, TemplateFileSchema } from "./schemas/template-validation.js";
16
16
  export { validateProtocolFile } from "./schemas/protocol-validation.js";
17
- export { extractCodeBlocks, extractYamlBlocks, readMdxPrompt, readMdxYaml, readPrompt, } from "./util_prompts";
18
- export { readMdx, importMdx } from "./util_mdx";
19
- /**
20
- * Test setup helpers live in a separate entry point to keep bun:test
21
- * out of the main bundle: import from "@modality-counter/core/testing".
22
- */
23
17
  /**
24
18
  * Protocols
25
19
  */
@@ -0,0 +1,2 @@
1
+ export { readMdx, importMdx } from "./util_mdx";
2
+ export { extractCodeBlocks, extractYamlBlocks, readMdxPrompt, readMdxYaml, readPrompt, } from "./util_prompts";
@@ -30,24 +30,13 @@ export type PartyMode = z.infer<typeof partyModeSchema>;
30
30
  * any client that sends flattened wire format.
31
31
  */
32
32
  export declare function liftDottedParams(input: unknown): unknown;
33
+ export declare function camelCaseParamKeys(input: unknown): unknown;
33
34
  /**
34
- * DO NOT REMOVE — LLM AGENT INSTRUCTION.
35
- *
36
- * Normalizes kebab-case method param keys to camelCase so CLI-style flags
37
- * (e.g. `--step-to`) bind to a method's camelCase Zod schema key (`stepTo`).
38
- * Method inputSchemas declare camelCase keys and Zod strips unknown keys under
39
- * its default mode, so without this an incoming `step-to` key reaches the
40
- * method's schema, is dropped, and the parameter is silently lost.
41
- *
42
- * Scope & safety:
43
- * - Hyphens only — snake_case keys (e.g. `chunk_index`) are left untouched so
44
- * methods that intentionally use underscores keep binding.
45
- * - A leading `--`/`-` from a literal flag token is stripped first.
46
- * - Collision-safe: if the camelCase key already exists on the object, the
47
- * kebab variant is dropped rather than overwriting it.
48
- * - Top-level params keys only; values are never recursed into.
35
+ * Parse CLI-style flag tokens carried in a params.input string
36
+ * (e.g. "--deep --fix") into boolean/valued param keys
37
+ * (e.g. { deep: true, fix: true }). Non-flag tokens are retained in `input`.
49
38
  */
50
- export declare function camelCaseParamKeys(input: unknown): unknown;
39
+ export declare function parseInputFlags(input: unknown): unknown;
51
40
  export declare const heroMethodSchema: z.ZodPreprocess<z.ZodObject<{
52
41
  method: z.ZodString;
53
42
  params: z.ZodOptional<z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodAny>, unknown>>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Parsed YAML frontmatter. `name` and `description` are the conventional
3
+ * fields every consumer reads; any other key may appear, so it is `unknown`
4
+ * and must be narrowed before use.
5
+ */
6
+ export interface Frontmatter {
7
+ name?: string;
8
+ description?: string;
9
+ [key: string]: unknown;
10
+ }
11
+ /**
12
+ * Parse YAML frontmatter from markdown/mdx content. Light dependency (yaml only)
13
+ * so it can be imported without pulling the heavy MDX/bun-plugin stack.
14
+ * Returns object with parsed frontmatter data and remaining content
15
+ * Handles both Unix (\n) and Windows (\r\n) line endings
16
+ */
17
+ export declare function parseFrontmatter(content: string): Frontmatter;
@@ -1,21 +1,6 @@
1
1
  import React from "react";
2
- /**
3
- * Parsed YAML frontmatter. `name` and `description` are the conventional
4
- * fields every consumer reads; any other key may appear, so it is `unknown`
5
- * and must be narrowed before use.
6
- */
7
- export interface Frontmatter {
8
- name?: string;
9
- description?: string;
10
- [key: string]: unknown;
11
- }
12
- /**
13
- * Parse YAML frontmatter from markdown/mdx content
14
- * Returns object with parsed frontmatter data and remaining content
15
- * Handles both Unix (\n) and Windows (\r\n) line endings
16
- */
17
- export declare function parseFrontmatter(content: string): Frontmatter;
18
2
  export declare const readMdx: (Component: React.ReactElement) => string;
19
3
  export declare const importMdx: (filePath: string) => Promise<any>;
20
4
  export declare const getDirName: () => string;
21
5
  export declare const importAbsoluteMdx: (absoluteFilePath: string) => Promise<any>;
6
+ export { parseFrontmatter, type Frontmatter } from "./util_frontmatter.js";
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.9.1",
2
+ "version": "2.9.4",
3
3
  "name": "@modality-counter/core",
4
4
  "repository": {
5
5
  "type": "git",
@@ -15,8 +15,8 @@
15
15
  "license": "ISC",
16
16
  "peerDependencies": {
17
17
  "modality-mcp-kit": "^2.1.0",
18
- "react": "^19.3.0",
19
- "react-dom": "^19.3.0"
18
+ "react": "^19.3.1",
19
+ "react-dom": "^19.3.1"
20
20
  },
21
21
  "dependencies": {
22
22
  "@mdx-js/esbuild": "^3.1.1",
@@ -27,13 +27,14 @@
27
27
  "node-html-markdown": "^2.0.0",
28
28
  "remark-frontmatter": "^5.0.0",
29
29
  "reshow-build": "^1.19.2",
30
+ "set-object-value": "^0.3.0",
30
31
  "ucfirst-js": "^0.2.0",
31
32
  "yaml": "^2.9.1"
32
33
  },
33
34
  "devDependencies": {
34
35
  "@types/react": "^19.3.0",
35
36
  "@types/react-dom": "^19.3.0",
36
- "modality-bun-kit": "^1.4.2",
37
+ "modality-bun-kit": "^1.4.4",
37
38
  "xdm": "3.4.0"
38
39
  },
39
40
  "exports": {
@@ -46,6 +47,11 @@
46
47
  "types": "./dist/types/testing.d.ts",
47
48
  "require": "./dist/testing.js",
48
49
  "import": "./dist/testing.js"
50
+ },
51
+ "./mdx": {
52
+ "types": "./dist/types/mdx.d.ts",
53
+ "require": "./dist/mdx.js",
54
+ "import": "./dist/mdx.js"
49
55
  }
50
56
  },
51
57
  "types": "./dist/types/index.d.ts",